Пример #1
0
 function GetPropertiesFromDataSet($DataSet)
 {
     $this->RoleID = ForceInt(@$DataSet['RoleID'], 0);
     $this->RoleName = ForceString(@$DataSet['Name'], '');
     $this->Icon = ForceString(@$DataSet['Icon'], '');
     $this->Description = ForceString(@$DataSet['Description'], '');
     $this->PERMISSION_SIGN_IN = ForceBool(@$DataSet['PERMISSION_SIGN_IN'], 0);
     $this->PERMISSION_HTML_ALLOWED = ForceBool(@$DataSet['PERMISSION_HTML_ALLOWED'], 0);
     $this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION = ForceBool(@$DataSet['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'], 0);
     $this->Unauthenticated = ForceBool(@$DataSet['Unauthenticated'], 0);
     $TempPermissions = '';
     $TempPermissions = ForceString(@$DataSet['Permissions'], '');
     $TempPermissions = UnserializeAssociativeArray($TempPermissions);
     $this->Permissions['PERMISSION_SIGN_IN'] = $this->PERMISSION_SIGN_IN;
     $this->Permissions['PERMISSION_HTML_ALLOWED'] = $this->PERMISSION_HTML_ALLOWED;
     $this->Permissions['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'] = $this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION;
     while (list($TempKey, $TempValue) = each($TempPermissions)) {
         $this->Permissions[$TempKey] = $TempValue;
     }
     unset($TempPermissions);
 }
 function GetPropertiesFromDataSet($DataSet)
 {
     $this->UserID = ForceInt(@$DataSet["UserID"], 0);
     $this->RoleID = ForceInt(@$DataSet["RoleID"], 0);
     $this->Role = ForceString(@$DataSet["Role"], "");
     $this->UserMainGroup = array(@$DataSet["UserMainGroup"] => @$DataSet["UserMainGroupName"]);
     if ($this->RoleID == 0 && $this->Context) {
         $this->Role = $this->Context->GetDefinition("Applicant");
     }
     $this->RoleIcon = ForceString(@$DataSet["RoleIcon"], "");
     $this->RoleDescription = ForceString(@$DataSet["RoleDescription"], "");
     $this->StyleID = ForceInt(@$DataSet["StyleID"], 0);
     $this->Style = ForceString(@$DataSet["Style"], "");
     $this->StyleUrl = ForceString(@$DataSet["StyleUrl"], "");
     $this->CustomStyle = ForceString(@$DataSet["CustomStyle"], "");
     $this->Name = ForceString(@$DataSet["Name"], "");
     $this->FirstName = ForceString(@$DataSet["FirstName"], "");
     $this->LastName = ForceString(@$DataSet["LastName"], "");
     $this->FullName = ForceString(@$DataSet["FullName"], "");
     $this->ShowName = ForceBool(@$DataSet["ShowName"], 0);
     $this->Email = ForceString(@$DataSet["Email"], "");
     $this->UtilizeEmail = ForceBool(@$DataSet["UtilizeEmail"], 0);
     $this->Icon = ForceString(@$DataSet["Icon"], "");
     $this->Picture = ForceString(@$DataSet["Picture"], "");
     $this->Discovery = ForceString(@$DataSet["Discovery"], "");
     $this->Attributes = "";
     $this->Attributes = ForceString(@$DataSet["Attributes"], "");
     $this->Attributes = UnserializeArray($this->Attributes);
     $this->Attributes = UnserializeArray($this->Attributes);
     $this->UserGroups = $this->GetUsersEGWGroupByUserID($this->UserID);
     $this->SendNewApplicantNotifications = ForceBool(@$DataSet["SendNewApplicantNotifications"], 0);
     if ($this->RoleIcon != "") {
         $this->DisplayIcon = $this->RoleIcon;
     } else {
         $this->DisplayIcon = $this->Icon;
     }
     $this->Settings = "";
     $this->Settings = ForceString(@$DataSet["Settings"], "");
     $this->Settings = UnserializeAssociativeArray($this->Settings);
     $this->DateFirstVisit = UnixTimestamp(@$DataSet["DateFirstVisit"]);
     $this->DateLastActive = UnixTimestamp(@$DataSet["DateLastActive"]);
     $this->CountVisit = ForceInt(@$DataSet["CountVisit"], 0);
     $this->CountDiscussions = ForceInt(@$DataSet["CountDiscussions"], 0);
     $this->CountComments = ForceInt(@$DataSet["CountComments"], 0);
     $this->RemoteIp = ForceString(@$DataSet["RemoteIp"], "");
     $this->BlocksCategories = ForceBool(@$DataSet["UserBlocksCategories"], 0);
     $this->DefaultFormatType = ForceString(@$DataSet["DefaultFormatType"], agDEFAULTSTRINGFORMAT);
     $this->CanLogin = ForceBool(@$DataSet["CanLogin"], 0);
     $this->CanPostDiscussion = ForceBool(@$DataSet["CanPostDiscussion"], 0);
     $this->CanViewIps = ForceBool(@$DataSet["CanViewIps"], 0);
     $this->CanPostComment = ForceBool(@$DataSet["CanPostComment"], 0);
     $this->CanPostHTML = ForceBool(@$DataSet["CanPostHTML"], 0);
     $this->AdminUsers = ForceBool(@$DataSet["AdminUsers"], 0);
     $this->AdminCategories = ForceBool(@$DataSet["AdminCategories"], 0);
     $this->MasterAdmin = ForceBool(@$DataSet["MasterAdmin"], 0);
     $this->ShowAllWhispers = ForceBool(@$DataSet["ShowAllWhispers"], 0);
     if (!$this->AdminCategories) {
         $this->Setting["ShowDeletedDiscussions"] = 0;
         $this->Setting["ShowDeletedComments"] = 0;
     }
     // change the user's style if they've selected no style
     if ($this->StyleID == 0) {
         $this->Style = "Custom";
         $this->StyleUrl = ForceString($this->CustomStyle, agDEFAULT_STYLE);
     }
 }
 function GetPropertiesFromDataSet($DataSet)
 {
     $this->UserID = ForceInt(@$DataSet['UserID'], 0);
     $this->RoleID = ForceInt(@$DataSet['RoleID'], 0);
     $this->Role = ForceString(@$DataSet['Role'], '');
     if ($this->RoleID == 0 && $this->Context) {
         $this->Role = $this->Context->GetDefinition('Applicant');
     }
     $this->RoleIcon = ForceString(@$DataSet['RoleIcon'], '');
     $this->RoleDescription = ForceString(@$DataSet['RoleDescription'], '');
     $this->StyleID = ForceInt(@$DataSet['StyleID'], 0);
     $this->Style = ForceString(@$DataSet['Style'], '');
     $this->StyleUrl = ForceString(@$DataSet['StyleUrl'], '');
     $this->CustomStyle = ForceString(@$DataSet['CustomStyle'], '');
     $this->Name = ForceString(@$DataSet['Name'], '');
     $this->FirstName = ForceString(@$DataSet['FirstName'], '');
     $this->LastName = ForceString(@$DataSet['LastName'], '');
     $this->FullName = trim($this->FirstName . ' ' . $this->LastName);
     $this->ShowName = ForceBool(@$DataSet['ShowName'], 0);
     $this->Email = ForceString(@$DataSet['Email'], '');
     $this->UtilizeEmail = ForceBool(@$DataSet['UtilizeEmail'], 0);
     $this->Icon = ForceString(@$DataSet['Icon'], '');
     $this->Picture = ForceString(@$DataSet['Picture'], '');
     $this->Discovery = ForceString(@$DataSet['Discovery'], '');
     $this->Attributes = '';
     $this->Attributes = ForceString(@$DataSet['Attributes'], '');
     $this->Attributes = UnserializeArray($this->Attributes);
     $this->SendNewApplicantNotifications = ForceBool(@$DataSet['SendNewApplicantNotifications'], 0);
     if ($this->RoleIcon != '') {
         $this->DisplayIcon = $this->RoleIcon;
     } else {
         $this->DisplayIcon = $this->Icon;
     }
     $this->Preferences = '';
     $this->Preferences = ForceString(@$DataSet['Preferences'], '');
     $this->Preferences = UnserializeAssociativeArray($this->Preferences);
     $this->DateFirstVisit = UnixTimestamp(@$DataSet['DateFirstVisit']);
     $this->DateLastActive = UnixTimestamp(@$DataSet['DateLastActive']);
     $this->CountVisit = ForceInt(@$DataSet['CountVisit'], 0);
     $this->CountDiscussions = ForceInt(@$DataSet['CountDiscussions'], 0);
     $this->CountComments = ForceInt(@$DataSet['CountComments'], 0);
     $this->RemoteIp = ForceString(@$DataSet['RemoteIp'], '');
     $this->BlocksCategories = ForceBool(@$DataSet['UserBlocksCategories'], 0);
     $this->DefaultFormatType = ForceString(@$DataSet['DefaultFormatType'], $this->Context->Configuration['DEFAULT_FORMAT_TYPE']);
     // User Role Permissions
     $this->PERMISSION_SIGN_IN = ForceBool(@$DataSet['PERMISSION_SIGN_IN'], $this->Context->Configuration['PERMISSION_SIGN_IN']);
     $this->PERMISSION_HTML_ALLOWED = ForceBool(@$DataSet['PERMISSION_HTML_ALLOWED'], $this->Context->Configuration['PERMISSION_HTML_ALLOWED']);
     $this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION = ForceBool(@$DataSet['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'], $this->Context->Configuration['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION']);
     $this->Permissions = '';
     $this->Permissions = ForceString(@$DataSet['Permissions'], '');
     $this->Permissions = UnserializeAssociativeArray($this->Permissions);
     $this->Permissions['PERMISSION_SIGN_IN'] = $this->PERMISSION_SIGN_IN;
     $this->Permissions['PERMISSION_HTML_ALLOWED'] = $this->PERMISSION_HTML_ALLOWED;
     $this->Permissions['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'] = $this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION;
     // If this user doesn't have permission to do things, force their preferences to abide.
     if (!$this->Permission('PERMISSION_VIEW_HIDDEN_DISCUSSIONS')) {
         $this->Setting['ShowDeletedDiscussions'] = 0;
     }
     if (!$this->Permission('PERMISSION_VIEW_HIDDEN_COMMENTS')) {
         $this->Setting['ShowDeletedComments'] = 0;
     }
     if (!$this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION) {
         $this->SendNewApplicantNotifications = 0;
     }
     // change the user's style if they've selected no style
     if ($this->StyleID == 0) {
         $this->Style = 'Custom';
         $this->StyleUrl = ForceString($this->CustomStyle, $this->Context->Configuration['DEFAULT_STYLE']);
     }
     $this->Password = ForceString(@$DataSet['Password'], '*');
     $this->VerificationKey = ForceString(@$DataSet['VerificationKey'], '');
 }