Example #1
0
		private function get($where, $var, $userPermissionsArray = null) {
			$db = Loader::db();
			$q = "select Users.uID, Users.uLastLogin, Users.uIsValidated, Users.uPreviousLogin, Users.uIsFullRecord, Users.uNumLogins, Users.uDateAdded, Users.uIsActive, Users.uLastOnline, Users.uHasAvatar, Users.uName, Users.uEmail, Users.uPassword, Users.uTimezone from Users " . $where;
			$r = $db->query($q, array($var));
			if ($r && $r->numRows() > 0) {
				$ui = new UserInfo;
				$row = $r->fetchRow();
				$ui->setPropertiesFromArray($row);
				$r->free();
			}
			
			if (is_object($ui)) {
				if ($userPermissionsArray) {
					if (isset($userPermissionsArray['permissions'])) {
						$ui->permissions = $userPermissionsArray['permissions'];
						if ($ui->permissions['canRead']) {
							$ui->permissionSet .= 'r:';
						}
						if ($ui->permissions['canWrite']) {
							$ui->permissionSet .= 'wa:';
						}
						if ($ui->permissions['canAdmin']) {
							$ui->permissionSet .= 'adm:';
						}

					} else {
						$ui->permissionSet = $userPermissionsArray['permissionSet'];
						$ui->upStartDate = $userPermissionsArray['upStartDate'];
						$ui->upEndDate = $userPermissionsArray['upEndDate'];
					}
				}

				return $ui;
			}
		}
Example #2
0
 private function get($where, $var)
 {
     $db = Loader::db();
     $q = "select Users.uID, Users.uLastLogin, Users.uLastIP, Users.uIsValidated, Users.uPreviousLogin, Users.uIsFullRecord, Users.uNumLogins, Users.uDateAdded, Users.uIsActive, Users.uLastOnline, Users.uHasAvatar, Users.uName, Users.uEmail, Users.uPassword, Users.uTimezone from Users " . $where;
     $r = $db->query($q, array($var));
     if ($r && $r->numRows() > 0) {
         $ui = new UserInfo();
         $row = $r->fetchRow();
         $ui->setPropertiesFromArray($row);
         $r->free();
     }
     if (is_object($ui)) {
         return $ui;
     }
 }