mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Switched or and and to || and && for code quality
This commit is contained in:
parent
814f8ea5fb
commit
4e38f96f97
|
@ -89,7 +89,7 @@ class AuthController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connecting to LDAP
|
// Connecting to LDAP
|
||||||
$connection = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");
|
$connection = ldap_connect($ldaphost) || die("Could not connect to {$ldaphost}");
|
||||||
// Needed for AD
|
// Needed for AD
|
||||||
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
|
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
|
||||||
ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, $ldapversion);
|
ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, $ldapversion);
|
||||||
|
@ -210,7 +210,7 @@ class AuthController extends Controller
|
||||||
|
|
||||||
if ($this->ldap(Input::get('username'), Input::get('password'))) {
|
if ($this->ldap(Input::get('username'), Input::get('password'))) {
|
||||||
LOG::debug("Valid LDAP login. Updating the local data.");
|
LOG::debug("Valid LDAP login. Updating the local data.");
|
||||||
$user = User::find($user->id);
|
$user = User::find($user->id); //need the Sentry object, not the Eloquent object, to access critical password hashing functions
|
||||||
$user->password = bcrypt(Input::get('password'));
|
$user->password = bcrypt(Input::get('password'));
|
||||||
$user->ldap_import = 1;
|
$user->ldap_import = 1;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
|
@ -638,7 +638,7 @@ class UsersController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we have permission to unsuspend this user?
|
// Do we have permission to unsuspend this user?
|
||||||
if ($user->isSuperUser() and ! Auth::user()->isSuperUser()) {
|
if ($user->isSuperUser() && !Auth::user()->isSuperUser()) {
|
||||||
// Redirect to the user management page
|
// Redirect to the user management page
|
||||||
return redirect()->route('users')->with('error', 'Insufficient permissions!');
|
return redirect()->route('users')->with('error', 'Insufficient permissions!');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue