Merge pull request #10144 from owncloud/issue/9972
Issue/9972 Fix issues with group and username `0`
This commit is contained in:
commit
a72dae6842
|
@ -185,7 +185,7 @@ class OC_Group_Database extends OC_Group_Backend {
|
|||
public function groupExists($gid) {
|
||||
$query = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups` WHERE `gid` = ?');
|
||||
$result = $query->execute(array($gid))->fetchOne();
|
||||
if ($result) {
|
||||
if ($result !== false) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -126,7 +126,7 @@ class Manager extends PublicEmitter implements IGroupManager {
|
|||
* @return \OC\Group\Group
|
||||
*/
|
||||
public function createGroup($gid) {
|
||||
if (!$gid) {
|
||||
if ($gid === '' || is_null($gid)) {
|
||||
return false;
|
||||
} else if ($group = $this->get($gid)) {
|
||||
return $group;
|
||||
|
|
|
@ -337,7 +337,7 @@ class OC_User {
|
|||
* Checks if the user is logged in
|
||||
*/
|
||||
public static function isLoggedIn() {
|
||||
if (\OC::$session->get('user_id') && self::$incognitoMode === false) {
|
||||
if (\OC::$session->get('user_id') !== null && self::$incognitoMode === false) {
|
||||
return self::userExists(\OC::$session->get('user_id'));
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -106,7 +106,7 @@ class Session implements IUserSession, Emitter {
|
|||
return $this->activeUser;
|
||||
} else {
|
||||
$uid = $this->session->get('user_id');
|
||||
if ($uid) {
|
||||
if ($uid !== null) {
|
||||
$this->activeUser = $this->manager->get($uid);
|
||||
return $this->activeUser;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue