Пример #1
0
function CCSecurityAccessCheck($GroupsAccess)
{
    $ErrorType = "success";
    if (!strlen(CCGetUserID())) {
        $ErrorType = "notLogged";
    } else {
        $GroupID = CCGetGroupID();
        if (!strlen($GroupID)) {
            $ErrorType = "groupIDNotSet";
        } else {
            if (!CCUserInGroups($GroupID, $GroupsAccess)) {
                $ErrorType = "illegalGroup";
            }
        }
    }
    return $ErrorType;
}
Пример #2
0
 function clsRecordemails1()
 {
     global $FileName;
     $this->Visible = true;
     $this->Errors = new clsErrors();
     $this->ds = new clsemails1DataSource();
     $this->ReadAllowed = false;
     $this->InsertAllowed = false;
     $this->UpdateAllowed = false;
     $this->DeleteAllowed = false;
     $this->Visible = CCSecurityAccessCheck("1;2") == "success";
     if ($this->Visible) {
         $this->ReadAllowed = CCUserInGroups(CCGetGroupID(), "1;2");
         $this->InsertAllowed = CCUserInGroups(CCGetGroupID(), "1;2");
         $this->ComponentName = "emails1";
         $this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $this->ComponentName);
         $CCSForm = CCGetFromGet("ccsForm", "");
         $this->FormSubmitted = $CCSForm == $this->ComponentName;
         $Method = $this->FormSubmitted ? ccsPost : ccsGet;
         $this->subject = new clsControl(ccsTextBox, "subject", "Amount", ccsText, "", CCGetRequestParam("subject", $Method));
         $this->subject->Required = true;
         $this->message = new clsControl(ccsTextArea, "message", "Message", ccsMemo, "", CCGetRequestParam("message", $Method));
         $this->Insert = new clsButton("Insert");
         $this->item_id = new clsControl(ccsHidden, "item_id", "Item Id", ccsInteger, "", CCGetRequestParam("item_id", $Method));
         $this->to_user_id = new clsControl(ccsHidden, "to_user_id", "To User Id", ccsInteger, "", CCGetRequestParam("to_user_id", $Method));
         $this->from_user_id = new clsControl(ccsHidden, "from_user_id", "From User Id", ccsInteger, "", CCGetRequestParam("from_user_id", $Method));
         $this->emaildate = new clsControl(ccsHidden, "emaildate", "date", ccsInteger, "", CCGetRequestParam("emaildate", $Method));
         if (!$this->FormSubmitted) {
             if (!strlen($this->subject->GetValue())) {
                 $this->subject->SetValue(0.0);
             }
         }
     }
 }