Esempio n. 1
0
         //learning rights
         $oAccess = CLearnAccess::GetInstance($USER->GetID());
         $perms = $oAccess->GetBasePermissions();
         CLearnAccess::ListAllPossibleRights();
         $arRights = CLearnAccess::ListAllPossibleRights();
         foreach ($arRights as $id => $right) {
             if ($right["name"] == "learning_lesson_access_manage_dual") {
                 $taskId = $id;
                 break;
             }
         }
         $perms["G" . $SiteGroups["PORTAL_ADMINISTRATION_" . WIZARD_SITE_ID]] = $taskId;
         $oAccess->SetBasePermissions($perms);
     }
 }
 WizardServices::SetFilePermission(array(WIZARD_SITE_ID, WIZARD_SITE_DIR . "upload/"), array("*" => "R"));
 //admin security policy
 $z = CGroup::GetByID(1);
 if ($res = $z->Fetch()) {
     if ($res["SECURITY_POLICY"] == "") {
         $group = new CGroup();
         $arGroupPolicy = array("SESSION_TIMEOUT" => 15, "SESSION_IP_MASK" => "255.255.255.255", "MAX_STORE_NUM" => 1, "STORE_IP_MASK" => "255.255.255.255", "STORE_TIMEOUT" => 60 * 24 * 3, "CHECKWORD_TIMEOUT" => 60, "PASSWORD_LENGTH" => 10, "PASSWORD_UPPERCASE" => "Y", "PASSWORD_LOWERCASE" => "Y", "PASSWORD_DIGITS" => "Y", "PASSWORD_PUNCTUATION" => "Y", "LOGIN_ATTEMPTS" => 3);
         $arFields = array("SECURITY_POLICY" => serialize($arGroupPolicy));
         $group->Update(1, $arFields);
     }
 }
 if (!WIZARD_IS_RERUN === false) {
     $dbResult = CGroup::GetList($by, $order, array("STRING_ID" => "EMPLOYEES_" . WIZARD_SITE_ID, "STRING_ID_EXACT_MATCH" => "Y"));
     if ($arExistsGroup = $dbResult->Fetch()) {
         $groupID = $arExistsGroup["ID"];
     }
Esempio n. 2
0
$userGroupID = "";
$dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
if ($arGroup = $dbGroup->Fetch()) {
    $userGroupID = $arGroup["ID"];
} else {
    $group = new CGroup();
    $arFields = array("ACTIVE" => "Y", "C_SORT" => 300, "NAME" => GetMessage("SALE_WIZARD_CONTENT_EDITOR"), "DESCRIPTION" => GetMessage("SALE_WIZARD_CONTENT_EDITOR_DESCR"), "USER_ID" => array(), "STRING_ID" => "content_editor");
    $userGroupID = $group->Add($arFields);
    $DB->Query("INSERT INTO b_sticker_group_task(GROUP_ID, TASK_ID)\tSELECT " . intVal($userGroupID) . ", ID FROM b_task WHERE NAME='stickers_edit' AND MODULE_ID='fileman'", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
}
if (IntVal($userGroupID) > 0) {
    WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R"));
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "main", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "P"));
    if ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "fileman", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "F"));
    if ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
    $SiteDir = "";
    if (WIZARD_SITE_ID != "s1") {
        $SiteDir = "/site_" . WIZARD_SITE_ID;
    }
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/index.php"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/about/"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/news/"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/catalog/"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/personal/"), array($userGroupID => "W"));
}
COption::SetOptionString("eshop", "wizard_installed", "Y", false, WIZARD_SITE_ID);
Esempio n. 3
0
 function OnPostForm()
 {
     $wizard =& $this->GetWizard();
     $site_id = $wizard->GetVar("siteID");
     if ($wizard->GetVar("templateID") == "light") {
         $res = $this->SaveFile("siteLogo", array("extensions" => "gif,jpg,jpeg,png", "max_height" => 72, "max_width" => 285, "make_preview" => "Y"));
     } elseif ($wizard->GetVar("templateID") == "bitrix24") {
         $this->SaveFile("siteLogo", array("extensions" => "gif,jpg,jpeg,png", "max_height" => 55, "max_width" => 222, "make_preview" => "Y"));
     } else {
         $this->SaveFile("siteLogo", array("extensions" => "gif,jpg,jpeg,png", "max_height" => 80, "max_width" => 90, "make_preview" => "Y"));
         COption::SetOptionString("main", "wizard_site_logo", "", false, $site_id);
     }
     if ($wizard->IsNextButtonClick()) {
         $rsSites = CSite::GetByID($site_id);
         if ($arSite = $rsSites->Fetch()) {
             $siteDir = $arSite["DIR"];
         }
         $firstStep = COption::GetOptionString("main", "wizard_first" . substr($wizard->GetID(), 7) . "_" . $wizard->GetVar("siteID"), false, $wizard->GetVar("siteID"));
         if (!$firstStep && $site_id != "s1") {
             $siteFolder = $wizard->GetVar("siteFolderDep");
             if (strlen(trim($siteFolder, " /")) == 0 || !preg_match('#^/(\\w+|_)/$#', $siteFolder)) {
                 $this->SetError(GetMessage("wiz_site_folder_error"));
                 return;
             } else {
                 $rsSites = CSite::GetList($by = "sort", $order = "desc", array());
                 while ($arSite = $rsSites->Fetch()) {
                     if ($arSite["ID"] == $site_id) {
                         continue;
                     }
                     if (trim($arSite["DIR"], "/") == trim($siteFolder, "/")) {
                         $this->SetError(GetMessage("wiz_site_folder_already_exists"));
                         return;
                     }
                 }
                 COption::SetOptionString("main", "wizard_site_folder", $siteFolder, false, $site_id);
             }
         } else {
             COption::SetOptionString("main", "wizard_site_folder", $siteDir, false, $site_id);
         }
         COption::SetOptionString("main", "site_name", $wizard->GetVar("siteName"), false, $site_id);
         $allowGuests = $wizard->GetVar("allowGuests");
         $allowGroup = $wizard->GetVar("allowGroup");
         COption::SetOptionString("main", "wizard_allow_group", $allowGroup == "Y" ? "Y" : "N", false, $site_id);
         COption::SetOptionString("main", "wizard_demo_data", "N", false, $site_id);
         $site_id = $wizard->GetVar("siteID");
         if ($site_id == 's1') {
             WizardServices::SetFilePermission(array(SITE_ID, "/"), array("2" => $allowGuests == "Y" ? "R" : "D"));
             COption::SetOptionString("main", "wizard_allow_guests", $allowGuests == "Y" ? "Y" : "N", false, $site_id);
             $allowLDAP = $wizard->GetVar("allowLDAP");
             if ($allowLDAP == "Y" && function_exists("ldap_connect") && IsModuleInstalled("ldap")) {
                 $wizard->SetCurrentStep("ldap_settings");
             }
             $allowRegistration = $wizard->GetVar("allowRegistration");
             COption::SetOptionString("main", "new_user_registration", $allowRegistration == "Y" ? "Y" : "N", false, "");
         }
         if ($wizard->GetVar("templateID") == "light" || $wizard->GetVar("templateID") == "bitrix24") {
             $useSiteLogo = $wizard->GetVar("useSiteLogo");
             COption::SetOptionString("main", "wizard_use_site_logo", $useSiteLogo == "Y" ? "Y" : "N", false, $site_id);
         }
     }
 }