Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Check if Soft Deleted on Login?
  • Hi,

    I need to run my user model extending Model_Soft so that I still have good tracking data to poll if an account is deleted.

    So, how do I check if the user has been soft deleted with simple auth? Do I need to? This is the first part of my admin controller for logging in:

    class Controller_Admin extends Controller_Base
    public $template = 'admin/template';

    public function before()

    $this->template->set_global('notification_count', \Model_Notification::count());

    if (Request::active()->controller !== 'Controller_Admin' or ! in_array(Request::active()->action, array('login', 'logout')))
    if (Auth::check())
    $admin_group_id = Config::get('auth.driver', 'Simpleauth') == 'Ormauth' ? 6 : 100;
    if ( ! Auth::member($admin_group_id))
    Session::set_flash('error', e('You don\'t have access to the admin panel'));

                    $u = Model_User::find(Auth::get_user_id()[1]);
                    $u->last_seen = time();
    if (Uri::segment(2)) {
    Response::redirect(Uri::base(false) . 'admin/login?destination=' . Uri::current());
    else {
  • HarroHarro
    Accepted Answer
    None of the Auth implementations support Soft Delete out of the box.

    You'll have to create your own Model_User, by copying it from the Auth package to your app, and then have it extend \Orm\Model_Soft instead of Orm\Model.

    And perhaps other changes are needed as well, depending on your requirements.
  • Ok, I'll work from the point of assuming zero support and go from there. Thanks.
  • Ok. You can ping Steve on IRC if you need more info, ORM is more his thing.

Howdy, Stranger!

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

In this Discussion