Zizaco / confide

Confide is a authentication solution for Laravel 4
1.19k stars 258 forks source link

Timeout fail to update an user using updateUniques() #279

Closed luthfianto closed 10 years ago

luthfianto commented 10 years ago

I got this FatalErrorException Maximum execution time of 30 seconds exceeded when I'm trying to update a field in my User model.

my UserController:

function aktifkan($id) {
  $user=User::find($id);
  $user->is_active=1;
  return ($user->updateUniques() ) ? 'success' : $user->errors();
}

If I change it to $user->save(), yes it'll pop The username has already been taken error

my composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.*",
        "laravelbook/ardent": "dev-master",
        "zizaco/confide": "3.2.*",
        "codesleeve/stapler": "dev-master",
        "mews/captcha": "dev-master"
    },
    "require-dev": {
        "way/generators": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

my User.php

<?php

use Zizaco\Confide\ConfideUser;

// class User extends Eloquent {
class User extends ConfideUser {

    public static $rules = array(
         'username' => 'unique:users,username',
         'email' => 'email'
     );

    protected $table = 'users';

    protected $hidden = ['password'];

    public function getAuthIdentifier()
    {
        return $this->getKey();
    }
    public function getAuthPassword()
    {
        return $this->password;
    }

    public function getRememberToken()
    {
        return $this->remember_token;
    }

    public function setRememberToken($value)
    {
        $this->remember_token = $value;
    }

    public function getRememberTokenName()
    {
        return 'remember_token';
    }

    public function getReminderEmail()
    {
        return $this->email;
    }

    function accountType() { return $this->belongsTo('AccountType'); }

    function team() { return $this->hasOne('Team'); }

}

That's it. I guess my code is similar to https://github.com/Zizaco/confide#update-an-user

Thanks in advance

molygoly commented 10 years ago

please at first check your email configuration. check port and mailserver.

i also have same issue. i have this error in both L 4.1 & L 4.2.

please take a look. thanks