Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
my own auth?
  • Hi, i need to create my own auth system, how can i do it? since there are no auth docs thanks
  • The Auth is essentially a "core" package, thus should be extended like a Core class: Extending Core classes
  • thanks it works :)
  • Simplest way to start would be to duplicate the simpleauth classes as a starting point into your app/classes/auto folder. Then add functionality from there.
  • Frank Bardon wrote on Monday 18th of July 2011:
    Simplest way to start would be to duplicate the simpleauth classes as a starting point into your app/classes/auto folder. Then add functionality from there.

    ok, thanks i will try i just need to copy and load auth packet right?
    no need to load the copied class?
  • Fuel autoloads everything, no need to load something manually unless you haven't followed the naming conventions. Do not modify the auth package itself. That will make updates to newer versions difficult. Copy the class file to your app folder, maintaining the same file structure (a class called Auth_This_That goes into app/auth/this/that.php). Also copy the auth config file to app/config, and modify it there to use your driver.
  • Harro Verton wrote on Tuesday 19th of July 2011:
    Fuel autoloads everything, no need to load something manually unless you haven't followed the naming conventions. Do not modify the auth package itself. That will make updates to newer versions difficult. Copy the class file to your app folder, maintaining the same file structure (a class called Auth_This_That goes into app/auth/this/that.php). Also copy the auth config file to app/config, and modify it there to use your driver.

    many thanks :)
  • im not getting how to override this classes i just copy 'packets/auth/classes/' into 'app/classes/' but nothing happen when i change code in it what should i do?
  • You also need to register those classes (if you're overwriting the original driver) in the app/bootstrap.php file, like here:
    Autoloader::add_classes(array(
     // Add classes you want to override here
     'Arr' => APPPATH.'classes/arr.php',
     'Date' => APPPATH.'classes/date.php',
        'Form' => APPPATH.'classes/form.php',
        'Str' => APPPATH.'classes/str.php',
        'Pagination' => APPPATH.'classes/pagination.php',
        'Validation' => APPPATH.'classes/validation.php',
     'Auth_Login_SimpleAuth' => APPPATH.'classes/auth/login/simpleauth.php',
    
    ));
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion