Пример #1
0
     }
     $new_global_user_perms = (double) $t_all_admin_tools | $t_all_forum_tools | $t_all_folder_mod | $t_all_links_mod | $t_all_banned | $t_confirm_email;
     if (perm_has_forumtools_access($uid) && $forum_tools_perm_count == 1) {
         if (!($new_global_user_perms & USER_PERM_FORUM_TOOLS)) {
             $error_msg_array[] = gettext("There must be at least 1 user with admin tools and forum tools access on all forums!");
             $valid = false;
         }
     }
     if (perm_has_global_admin_access($uid) && $admin_tools_perm_count == 1) {
         if (!($new_global_user_perms & USER_PERM_ADMIN_TOOLS)) {
             $error_msg_array[] = gettext("There must be at least 1 user with admin tools and forum tools access on all forums!");
             $valid = false;
         }
     }
     if ($valid && $new_global_user_perms != $global_user_perm) {
         if (perm_update_user_global_perms($uid, $new_global_user_perms)) {
             $global_user_perm = perm_get_global_user_permissions($uid);
         } else {
             $error_msg_array[] = gettext("Failed to update global user permissions");
             $valid = false;
         }
     }
 }
 // Local folder permissions
 if (forum_check_webtag_available($webtag)) {
     if (isset($_POST['t_update_perms_array']) && is_array($_POST['t_update_perms_array'])) {
         $t_update_perms_array = $_POST['t_update_perms_array'];
         $folder_array = perm_user_get_folders($uid);
         foreach ($t_update_perms_array as $fid) {
             $t_post_read = (double) isset($_POST['t_post_read'][$fid]) ? $_POST['t_post_read'][$fid] : 0;
             $t_post_create = (double) isset($_POST['t_post_create'][$fid]) ? $_POST['t_post_create'][$fid] : 0;
Пример #2
0
$sql .= "  UNIQUE KEY SID (SID),";
$sql .= "  KEY FORUM (FORUM),";
$sql .= "  KEY LAST_LOGON (LAST_LOGON),";
$sql .= "  KEY FORUM_LAST_LOGON (FORUM, LAST_LOGON), ";
$sql .= "  KEY IPADDRESS (IPADDRESS)";
$sql .= ") ENGINE=MYISAM DEFAULT CHARSET=UTF8";
$db->query($sql);
if (!install_set_default_forum_settings()) {
    throw new Exception('Failed to save forum settings');
}
if (!install_set_search_bots()) {
    throw new Exception('Failed to create search bot entries');
}
if (!install_set_timezones()) {
    throw new Exception('Failed to create timezone entries');
}
if (!($admin_uid = user_create($admin_username, $admin_password, $admin_username, $admin_email))) {
    throw new Exception('Failed to create admin user');
}
if (!perm_update_user_global_perms($admin_uid, USER_PERM_ADMIN_TOOLS | USER_PERM_FORUM_TOOLS)) {
    throw new Exception('Failed to set admin global permissions');
}
if (!($forum_fid = forum_create($forum_webtag, 'A Beehive Forum', $admin_uid, $config['db_database'], FORUM_UNRESTRICTED, false, $error_str))) {
    throw new Exception($error_str);
}
if (!forum_update_default($forum_fid)) {
    throw new Exception('Failed to set default forum');
}
if (!perm_update_user_forum_permissions($admin_uid, $forum_fid, USER_PERM_ADMIN_TOOLS)) {
    throw new Exception('Failed to set admin forum permissions');
}