$errors[] = lang("SQL_ERROR");
            }
        }
        //Remove access to pages
        if (!empty($_POST['removePage'])) {
            $remove = $_POST['removePage'];
            if ($deletion_count = removePage($remove, $permissionId)) {
                $successes[] = lang("PERMISSION_REMOVE_PAGES", array($deletion_count));
            } else {
                $errors[] = lang("SQL_ERROR");
            }
        }
        //Add access to pages
        if (!empty($_POST['addPage'])) {
            $add = $_POST['addPage'];
            if ($addition_count = addPage($add, $permissionId)) {
                $successes[] = lang("PERMISSION_ADD_PAGES", array($addition_count));
            } else {
                $errors[] = lang("SQL_ERROR");
            }
        }
        $permissionDetails = fetchPermissionDetails($permissionId);
    }
}
$pagePermissions = fetchPermissionPages($permissionId);
//Retrieve list of accessible pages
$permissionUsers = fetchPermissionUsers($permissionId);
//Retrieve list of users with membership
$userData = fetchAllUsers();
//Fetch all users
$pageData = fetchAllPages();
示例#2
0
        // First 6 words
        $seotitle = $_POST["seotitle"];
        $seodescrition = $_POST["seodescrition"];
        $seokeyword = $_POST["seokeyword"];
        $status = $_POST["status"];
        if (empty($name)) {
            $message .= 'Enter your page name<br>';
        }
        if (empty($content)) {
            $message .= 'Enter your page content<br>';
        }
        if ($status == '') {
            $status = 1;
        }
        if (empty($message)) {
            if (addPage($name, $content, $slug, $seotitle, $seodescrition, $seokeyword, $status, $mysqli) == true) {
                $message = 'Paged successfully created';
                header("Location: ../page.php?success={$message}");
                exit;
            } else {
                $message = 'Invalid';
                header("Location: ../page.php?action=add&error={$message}");
                exit;
            }
        } else {
            header("Location: ../page.php?action=add&error={$message}");
            exit;
        }
    }
}
function addPage($name, $content, $slug, $seotitle, $seodescrition, $seokeyword, $status, $mysqli)
示例#3
0
文件: menu.php 项目: hscale/SiteZilla
     }
 } elseif (isset($_GET['medit'])) {
     $mitemid = cleanGet($_GET['medit']);
     editMenuNameEditForm($siteid, $mitemid);
     $showmenu = false;
 } elseif (isset($_GET['up'])) {
     $mitemid = cleanGet($_GET['up']);
     editWebsiteMenuOrder($siteid, $mitemid, 'up');
 } elseif (isset($_GET['down'])) {
     $mitemid = cleanGet($_GET['down']);
     editWebsiteMenuOrder($siteid, $mitemid, 'down');
 } elseif (isset($_GET['addpage']) && isset($_POST['page_title']) && strlen($_POST['page_title']) > 1) {
     $page_title = cleanGet($_POST['page_title']);
     if (isActive($userid)) {
         if (maxSitePages($siteid) == false) {
             addPage($siteid, $page_title);
         } else {
             sysMsg(MSG00119);
         }
     } else {
         demoMsg();
     }
 } elseif (isset($_GET['changetitle']) && isset($_POST['old_page_id'])) {
     $pageid = cleanPost($_POST['old_page_id']);
     $title = cleanPost($_POST['new_page_title']);
     if (isActive($userid)) {
         changePageTitle($pageid, $title);
     } else {
         demoMsg();
     }
 }
示例#4
0
            $errors[] = lang("SQL_ERROR");
        }
    }
    //Remove permission level(s) access to page
    if (!empty($_POST['removePermission'])) {
        $remove = $_POST['removePermission'];
        if ($deletion_count = removePage($pageId, $remove)) {
            $successes[] = lang("PAGE_ACCESS_REMOVED", array($deletion_count));
        } else {
            $errors[] = lang("SQL_ERROR");
        }
    }
    //Add permission level(s) access to page
    if (!empty($_POST['addPermission'])) {
        $add = $_POST['addPermission'];
        if ($addition_count = addPage($pageId, $add)) {
            $successes[] = lang("PAGE_ACCESS_ADDED", array($addition_count));
        } else {
            $errors[] = lang("SQL_ERROR");
        }
    }
    $pageDetails = fetchPageDetails($pageId);
}
$pagePermissions = fetchPagePermissions($pageId);
$permissionData = fetchAllPermissions();
require_once "models/header.php";
echo "\n<body>\n<div class='container'>\n<div class='row'>\n";
include "top_nav.php";
echo "\n</div>\n<div class='row'>";
echo resultBlock($errors, $successes);
echo "\n<form role='form' class='form well' name='adminPage' action='" . $_SERVER['PHP_SELF'] . "?id=" . $pageId . "' method='post'>\n<input type='hidden' name='process' value='1'>\n<table class='table'>\n<tr><td>\n<h3>Page Information</h3>\n<div id='regbox'>\n<p>\n<label>ID:</label>\n" . $pageDetails['id'] . "\n</p>\n<p>\n<label>Name:</label>\n" . $pageDetails['page'] . "\n</p>\n<p>\n<label>Private:</label>";
示例#5
0
 // 更新時はデータを表示
 if ($updateFlg && REQUEST_METHOD == 'GET') {
     getRegisteredPageData($id, $category, $title, $description, $article);
 }
 $select = getCategories($category);
 $addSuccess = false;
 if (REQUEST_METHOD == 'POST') {
     if ($title == '') {
         setValidationMessage('title:titleは必ず入力してください');
     }
     // 入力チェックエラーがなければ登録処理を行う
     if (!$globalValidationError) {
         if ($updateFlg) {
             $addSuccess = editPage($id, $category, $title, $description, $article);
         } else {
             $addSuccess = addPage($category, $title, $description, $article);
         }
     }
 }
 // 入力チェックがあれば。もしくは登録失敗したら
 if ($globalValidationError || !$addSuccess) {
     // 失敗したら入力内容を表示
     $aft = [$select, $title, $description, $article, $globalMessage];
     $body .= pageInputHtml($aft);
     if ($updateFlg) {
         $globalFormAction = WEB_ROOT . '/publish?id=' . $id;
     } else {
         $globalFormAction = WEB_ROOT . '/publish';
     }
     $globalFormMethod = 'POST';
 } else {
示例#6
0
defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
function addPage($args)
{
    global $dbPages;
    global $Language;
    // Add the page.
    if ($dbPages->add($args)) {
        Alert::set($Language->g('Page added successfully'));
        Redirect::page('admin', 'manage-pages');
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the page.');
    }
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    addPage($_POST);
}
// ============================================================================
// Main after POST
// ============================================================================
示例#7
0
/**
 * Link/unlink the specified group with the specified page.  Recommend root access only.
 * @param int $page_id the id of the page
 * @param int $group_id the id of the group
 * @param boolean $checked 1 if private page 0 if public
 * @return boolean true for success, false if failed
 */
function updatePageGroupLink($page_id, $group_id, $checked)
{
    // This block automatically checks this action against the permissions database before running.
    if (!checkActionPermissionSelf(__FUNCTION__, func_get_args())) {
        addAlert("danger", "Sorry, you do not have permission to access this resource.");
        return false;
    }
    //Check if selected page exists
    if (!pageIdExists($page_id)) {
        addAlert("danger", "I'm sorry, the page id you specified is invalid!");
        return false;
    }
    //TODO: Check if selected group exists
    $pageDetails = fetchPageDetails($page_id);
    //Fetch information specific to page
    // Determine if we're changing the 'private' status, or a specific group
    if ($group_id == "private") {
        // Set as private if checked=1, otherwise set as 0
        updatePrivate($page_id, $checked);
        return true;
    } else {
        // Get the current page groups
        $pageGroups = fetchPageGroups($page_id);
        // Add the group if checked=1 and the page doesn't already have that group assigned
        if ($checked == "1") {
            if (!isset($pageGroups[$group_id])) {
                addPage($page_id, $group_id);
                return true;
            } else {
                return false;
            }
        } else {
            if (isset($pageGroups[$group_id])) {
                removePage($page_id, $group_id);
                return true;
            } else {
                return false;
            }
        }
    }
}
示例#8
0
                        $result->copy($as);
                        break;
                    case 'delete':
                        $reports[] = deletePage($result);
                        break;
                }
            }
        } else {
            $result = new ZenpagePage('');
            $result->setPermalink(1);
            $result->setDateTime(date('Y-m-d H:i:s'));
        }
    }
    if (isset($_GET['save'])) {
        XSRFdefender('save');
        $result = addPage($reports);
    }
    if (isset($_GET['delete'])) {
        XSRFdefender('delete');
        $msg = deletePage($_GET['delete']);
        if (!empty($msg)) {
            $reports[] = $msg;
        }
    }
}
if (is_AdminEditPage('newsarticle')) {
    $tab = 'news';
    if (isset($_GET['titlelink'])) {
        $result = new ZenpageNews(urldecode($_GET['titlelink']));
    } else {
        if (isset($_GET['update'])) {
示例#9
0
 public function index()
 {
     /*
     UserCake (Via CupCake) Version: 2.0.2
     http://usercake.com
     */
     global $baseURL;
     require_once "{$baseURL}/application/third_party/user_cake/models/config.php";
     if (!securePage($_SERVER['PHP_SELF'])) {
         die;
     }
     $permissionId = $_GET['id'];
     //Check if selected permission level exists
     if (!permissionIdExists($permissionId)) {
         header("Location: " . site_url('admin_permissions'));
         die;
     }
     $permissionDetails = fetchPermissionDetails($permissionId);
     //Fetch information specific to permission level
     //Forms posted
     if (!empty($_POST)) {
         //Delete selected permission level
         if (!empty($_POST['delete'])) {
             $deletions = $_POST['delete'];
             if ($deletion_count = deletePermission($deletions)) {
                 $successes[] = lang("PERMISSION_DELETIONS_SUCCESSFUL", array($deletion_count));
                 header("Location: " . site_url('admin_permissions'));
             } else {
                 $errors[] = lang("SQL_ERROR");
             }
         } else {
             //Update permission level name
             if ($permissionDetails[0]['name'] != $_POST['name']) {
                 $permission = trim($_POST['name']);
                 //Validate new name
                 if (permissionNameExists($permission)) {
                     $errors[] = lang("ACCOUNT_PERMISSIONNAME_IN_USE", array($permission));
                 } elseif (minMaxRange(1, 50, $permission)) {
                     $errors[] = lang("ACCOUNT_PERMISSION_CHAR_LIMIT", array(1, 50));
                 } else {
                     if (updatePermissionName($permissionId, $permission)) {
                         $successes[] = lang("PERMISSION_NAME_UPDATE", array($permission));
                     } else {
                         $errors[] = lang("SQL_ERROR");
                     }
                 }
             }
             //Remove access to pages
             if (!empty($_POST['removePermission'])) {
                 $remove = $_POST['removePermission'];
                 if ($deletion_count = removePermission($permissionId, $remove)) {
                     $successes[] = lang("PERMISSION_REMOVE_USERS", array($deletion_count));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
             //Add access to pages
             if (!empty($_POST['addPermission'])) {
                 $add = $_POST['addPermission'];
                 if ($addition_count = addPermission($permissionId, $add)) {
                     $successes[] = lang("PERMISSION_ADD_USERS", array($addition_count));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
             //Remove access to pages
             if (!empty($_POST['removePage'])) {
                 $remove = $_POST['removePage'];
                 if ($deletion_count = removePage($remove, $permissionId)) {
                     $successes[] = lang("PERMISSION_REMOVE_PAGES", array($deletion_count));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
             //Add access to pages
             if (!empty($_POST['addPage'])) {
                 $add = $_POST['addPage'];
                 if ($addition_count = addPage($add, $permissionId)) {
                     $successes[] = lang("PERMISSION_ADD_PAGES", array($addition_count));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
             $permissionDetails = fetchPermissionDetails($permissionId);
         }
     }
     $pagePermissions = fetchPermissionPages($permissionId);
     //Retrieve list of accessible pages
     $permissionUsers = fetchPermissionUsers($permissionId);
     //Retrieve list of users with membership
     $userData = fetchAllUsers();
     //Fetch all users
     $pageData = fetchAllPages();
     //Fetch all pages
     require_once "{$baseURL}/application/third_party/user_cake/models/header.php";
     echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n<h1>UserCake (Via CupCake)</h1>\r\n<h2>Admin Permissions</h2>\r\n<div id='left-nav'>";
     include "{$baseURL}/application/third_party/user_cake/left-nav.php";
     echo "\r\n</div>\r\n<div id='main'>";
     echo resultBlock($errors, $successes);
     echo "\r\n<form name='adminPermission' action='" . $_SERVER['PHP_SELF'] . "?id=" . $permissionId . "' method='post'>\r\n<table class='admin'>\r\n<tr><td>\r\n<h3>Permission Information</h3>\r\n<div id='regbox'>\r\n<p>\r\n<label>ID:</label>\r\n" . $permissionDetails[0]['id'] . "\r\n</p>\r\n<p>\r\n<label>Name:</label>\r\n<input type='text' name='name' value='" . $permissionDetails[0]['name'] . "' />\r\n</p>\r\n<label>Delete:</label>\r\n<input type='checkbox' name='delete[" . $permissionDetails[0]['id'] . "]' id='delete[" . $permissionDetails[0]['id'] . "]' value='" . $permissionDetails[0]['id'] . "'>\r\n</p>\r\n</div></td><td>\r\n<h3>Permission Membership</h3>\r\n<div id='regbox'>\r\n<p>\r\nRemove Members:";
     //List users with permission level
     foreach ($userData as $v1) {
         if (isset($permissionUsers[$v1['id']])) {
             echo "<br><input type='checkbox' name='removePermission[" . $v1['id'] . "]' id='removePermission[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['display_name'];
         }
     }
     echo "\r\n</p><p>Add Members:";
     //List users without permission level
     foreach ($userData as $v1) {
         if (!isset($permissionUsers[$v1['id']])) {
             echo "<br><input type='checkbox' name='addPermission[" . $v1['id'] . "]' id='addPermission[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['display_name'];
         }
     }
     echo "\r\n</p>\r\n</div>\r\n</td>\r\n<td>\r\n<h3>Permission Access</h3>\r\n<div id='regbox'>\r\n<p>\r\nPublic Access:";
     //List public pages
     foreach ($pageData as $v1) {
         if ($v1['private'] != 1) {
             echo "<br>" . $v1['page'];
         }
     }
     echo "\r\n</p>\r\n<p>\r\nRemove Access:";
     //List pages accessible to permission level
     foreach ($pageData as $v1) {
         if (isset($pagePermissions[$v1['id']]) and $v1['private'] == 1) {
             echo "<br><input type='checkbox' name='removePage[" . $v1['id'] . "]' id='removePage[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['page'];
         }
     }
     echo "\r\n</p><p>Add Access:";
     //List pages inaccessible to permission level
     foreach ($pageData as $v1) {
         if (!isset($pagePermissions[$v1['id']]) and $v1['private'] == 1) {
             echo "<br><input type='checkbox' name='addPage[" . $v1['id'] . "]' id='addPage[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['page'];
         }
     }
     echo "\r\n</p>\r\n</div>\r\n</td>\r\n</tr>\r\n</table>\r\n<p>\r\n<label>&nbsp;</label>\r\n<input type='submit' value='Update' class='submit' />\r\n</p>\r\n</form>\r\n</div>\r\n<div id='bottom'></div>\r\n</div>\r\n</body>\r\n</html>";
 }
示例#10
0
<?php

function addPage($nom, $lien, $visible)
{
    $page['nom'] = $nom;
    $page['lien'] = $lien;
    $page['visible'] = $visible;
    return $page;
}
$datas['NomSite'] = "Helpr";
$datas['Page']['index'] = addPage("Accueil", "accueil", true);
$datas['Page']['concept'] = addPage("Le concept", "concept", true);
$datas['Page']['mentions_legales'] = addPage("Mentions Légales", "mentions_legales", true);
$datas['Page']['categories'] = addPage("Catégories", "categories", false);
$datas['Page']['casse-brique'] = addPage("Casse-Brique", "casse-brique", false);
$datas['Page']['map'] = addPage("Carte", "map", true);
try {
    $bdd = new PDO('mysql:host=localhost;dbname=helpr', 'root', '');
    $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $bdd->exec("SET NAMES 'utf8'");
} catch (Exception $e) {
    die('Erreur : ' . $e->getMessage());
}
$smarty->assign('datas', $datas);
示例#11
0
function adminFuncSwitch()
{
    if (isset($_GET['action'])) {
        switch ($_GET['action']) {
            case "addpage":
                $pageAdded = addPage();
                if ($pageAdded) {
                    performEdit($pageAdded);
                }
                break;
            case "extlink":
                $xLinkAdded = addExtLink();
                if ($xLinkAdded) {
                    performEditLink($xLinkAdded);
                }
                break;
            case "addinfo":
                $pageAdded = addPage();
                if ($pageAdded) {
                    performEdit($pageAdded);
                }
                break;
            case 'delete':
                doDelete();
                break;
            case 'edit':
                performEdit();
                break;
            case 'editinfo':
                performEdit();
                break;
            case 'editextlink':
                performEditLink();
                break;
            case 'showpages':
                manageContent();
                break;
            case 'showcats':
                manageCats();
                break;
            case 'showinfobar':
                manageInfobar();
                break;
            case 'fileman':
                fileManager();
                break;
            case 'filemanview':
                fileManager();
                break;
            case 'backuptool':
                backupTool_settings();
                break;
            case 'reordercat':
                performMove();
                manageCats();
                break;
            case 'reorderinfo':
                performMove();
                manageInfobar();
                break;
            case 'blademan':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('system');
                }
                break;
            case 'bladesystem':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('system');
                }
                break;
            case 'bladetheme':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('theme');
                }
                break;
            case 'bladelanguage':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('language');
                }
                break;
            case 'bladeupgrade':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('upgrade');
                }
                break;
            case 'bladeinstall':
                if ($_SESSION['adminType'] != 'user') {
                    bladepackInstall();
                }
                break;
            case 'coresettings':
                if ($_SESSION['adminType'] != 'user') {
                    coreSettings();
                }
                break;
            case 'settingsman':
                if ($_SESSION['adminType'] != 'user') {
                    bladeSettings();
                }
                break;
            case 'usermanager':
                if ($_SESSION['adminType'] == 'admin') {
                    userManager('admin');
                } else {
                    userManager();
                }
                break;
            case 'userdata':
                userManager();
                break;
            case 'admindata':
                userManager('admin');
                break;
            case 'sadmindata':
                userManager('sadmin');
                break;
            case 'version':
                versionCheck();
                break;
            case 'helpinfo':
                helpAndInfo();
                break;
            case 'maintenance':
                maintenanceMode();
                break;
            default:
                $foundMenu = false;
                BsocketB('admin-page-select', array(&$foundMenu));
                if (!$foundMenu) {
                    versionCheck();
                }
        }
    } else {
        versionCheck();
    }
}
示例#12
0
 $user = $parts[4] == 'Anonymous' ? '' : $parts[4];
 $ipall = '';
 if (($p = strpos($addr, ',')) !== false) {
     $ip = substr($addr, 0, $p);
     $ipall = $addr;
 } else {
     $ip = $addr;
 }
 $ip2long = sprintf("%u", ip2long($ip));
 $page_id = 0;
 $pagename = $DBInfo->keyToPagename($page_key);
 if ($db) {
     if (($id = getPageID($pagename, $db)) !== false) {
         $page_id = $id;
     } else {
         $page_id = addPage($pagename, $curid, $db, $mtime);
         // page creation time
         if ($page_id < 0) {
             echo "FATAL: Unable to add page!\n";
             exit;
         }
         // page added successfully
         if ($page_id == $curid) {
             $curid++;
         }
     }
 } else {
     if (file_exists($pages_dir . '/' . $page_key)) {
         $tmp = file($pages_dir . '/' . $page_key);
         $page_id = $tmp[0];
     } else {
    $link = "playlist/" . $link;
    $title = $name . " Playlist";
    $page = new page();
    $page->addPage($link, $title, $description, "Switch", "VideoChunk");
}
if (isset($_GET['name']) && isset($_GET['link']) && isset($_GET['status']) && isset($_GET['autoPlaylist']) && isset($_GET['description'])) {
    $name = $_GET['name'];
    $link = $_GET['link'];
    $status = $_GET['status'];
    $autoPlaylist = $_GET['autoPlaylist'];
    $description = $_GET['description'];
    $db = new db();
    $db->connect();
    $id = addPlaylist($name, $link, $status);
    addAutoPlaylist($autoPlaylist, $id);
    addPage($link, $name, $description);
    mysql_close();
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript">
        function submit(){
            var name = $("#input-name").val();
            var link = $("#input-link").val();
            var status = $("#input-status").val();
            var autoPlaylist = $("#input-autoPlaylist").val();
            var description = $("#input-description").val();
示例#14
0
 public function index()
 {
     /*
     UserCake (Via CupCake) Version: 2.0.2
     http://usercake.com
     */
     global $baseURL;
     require_once "{$baseURL}/application/third_party/user_cake/models/config.php";
     if (!securePage($_SERVER['PHP_SELF'])) {
         die;
     }
     $pageId = $_GET['id'];
     //Check if selected pages exist
     if (!pageIdExists($pageId)) {
         header("Location: " . str_replace('index.php/', '', site_url('admin_pages')));
         die;
     }
     $pageDetails = fetchPageDetails($pageId);
     //Fetch information specific to page
     //Forms posted
     if (!empty($_POST)) {
         $update = 0;
         if (!empty($_POST['private'])) {
             $private = $_POST['private'];
         }
         //Toggle private page setting
         if (isset($private) and $private == 'Yes') {
             if ($pageDetails['private'] == 0) {
                 if (updatePrivate($pageId, 1)) {
                     $successes[] = lang("PAGE_PRIVATE_TOGGLED", array("private"));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
         } elseif ($pageDetails['private'] == 1) {
             if (updatePrivate($pageId, 0)) {
                 $successes[] = lang("PAGE_PRIVATE_TOGGLED", array("public"));
             } else {
                 $errors[] = lang("SQL_ERROR");
             }
         }
         //Remove permission level(s) access to page
         if (!empty($_POST['removePermission'])) {
             $remove = $_POST['removePermission'];
             if ($deletion_count = removePage($pageId, $remove)) {
                 $successes[] = lang("PAGE_ACCESS_REMOVED", array($deletion_count));
             } else {
                 $errors[] = lang("SQL_ERROR");
             }
         }
         //Add permission level(s) access to page
         if (!empty($_POST['addPermission'])) {
             $add = $_POST['addPermission'];
             if ($addition_count = addPage($pageId, $add)) {
                 $successes[] = lang("PAGE_ACCESS_ADDED", array($addition_count));
             } else {
                 $errors[] = lang("SQL_ERROR");
             }
         }
         $pageDetails = fetchPageDetails($pageId);
     }
     $pagePermissions = fetchPagePermissions($pageId);
     $permissionData = fetchAllPermissions();
     require_once "{$baseURL}/application/third_party/user_cake/models/header.php";
     echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n<h1>UserCake (Via CupCake)</h1>\r\n<h2>Admin Page</h2>\r\n<div id='left-nav'>";
     include "{$baseURL}/application/third_party/user_cake/left-nav.php";
     echo "\r\n</div>\r\n<div id='main'>";
     echo resultBlock($errors, $successes);
     echo "\r\n<form name='adminPage' action='" . $_SERVER['PHP_SELF'] . "?id=" . $pageId . "' method='post'>\r\n<input type='hidden' name='process' value='1'>\r\n<table class='admin'>\r\n<tr><td>\r\n<h3>Page Information</h3>\r\n<div id='regbox'>\r\n<p>\r\n<label>ID:</label>\r\n" . $pageDetails['id'] . "\r\n</p>\r\n<p>\r\n<label>Name:</label>\r\n" . $pageDetails['page'] . "\r\n</p>\r\n<p>\r\n<label>Private:</label>";
     //Display private checkbox
     if ($pageDetails['private'] == 1) {
         echo "<input type='checkbox' name='private' id='private' value='Yes' checked>";
     } else {
         echo "<input type='checkbox' name='private' id='private' value='Yes'>";
     }
     echo "\r\n</p>\r\n</div></td><td>\r\n<h3>Page Access</h3>\r\n<div id='regbox'>\r\n<p>\r\nRemove Access:";
     //Display list of permission levels with access
     foreach ($permissionData as $v1) {
         if (isset($pagePermissions[$v1['id']])) {
             echo "<br><input type='checkbox' name='removePermission[" . $v1['id'] . "]' id='removePermission[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['name'];
         }
     }
     echo "\r\n</p><p>Add Access:";
     //Display list of permission levels without access
     foreach ($permissionData as $v1) {
         if (!isset($pagePermissions[$v1['id']])) {
             echo "<br><input type='checkbox' name='addPermission[" . $v1['id'] . "]' id='addPermission[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['name'];
         }
     }
     echo "\r\n</p>\r\n</div>\r\n</td>\r\n</tr>\r\n</table>\r\n<p>\r\n<label>&nbsp;</label>\r\n<input type='submit' value='Update' class='submit' />\r\n</p>\r\n</form>\r\n</div>\r\n<div id='bottom'></div>\r\n</div>\r\n</body>\r\n</html>";
 }
示例#15
0
function newWebsite($userid)
{
    $db = Database::obtain();
    $website = array();
    $website['website_name'] = MSG00175;
    $website['website_url'] = 'www.thiswebsite.domain';
    $website['website_protect'] = '0';
    $website['website_menu'] = 'a:1:{}';
    $website['website_user'] = $userid;
    $website['website_email'] = '*****@*****.**';
    $website['website_template'] = 'blacknwhite';
    $website['website_description'] = MSG00176;
    $website['website_keywords'] = MSG00177;
    //XXXXX Grab user language
    $website['website_language'] = 'English';
    $website['searchengine_revisit'] = '5';
    $website['creator_name'] = userFullName($userid);
    $website['creator_website'] = userWebsite($userid);
    $website_id = $db->insert("websites", $website);
    if ($website_id != 0) {
        editMenuReset($website_id);
        addPage($website_id, MSG00174);
        addPage($website_id, MSG00173);
        addPage($website_id, MSG00172);
        addPage($website_id, MSG00171);
        $website_folder = 'content/' . $website_id;
        createDir($website_folder);
        createDir($website_folder . '/files');
        sysMsg(MSG00170);
        return $website_id;
    } else {
        sysMsg(MSG00169);
    }
}