Example #1
0
 public function modifyPassword($password)
 {
     // check to see if there is an LDAP connection for this environment
     //
     $ldapConnectionConfig = Config::get('ldap.connections.' . App::environment());
     if ($ldapConnectionConfig) {
         // use LDAP
         //
         return LDAP::modifyPassword($this, $password);
     } else {
         // encrypt password
         //
         $this->password = User::getEncryptedPassword($password, '{SSHA}', $this->password);
         // use SQL / Eloquent
         //
         $this->save();
         return $this;
     }
 }