示例#1
0
<?php

/**
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_index');
Security::promptAuth();
$index = new AdminFrontend();
$index->main(array("time" => time(), "page_title" => "Dashboard", "page_template" => "dashboard"));
if (isset($_GET['msg'])) {
    switch ($_GET['msg']) {
        case 0:
            $index->addMessage(l("No Permission"), "error");
            break;
        case 1:
            $index->addMessage(l("Invalid Query Arg"), "warning");
            break;
        case 2:
            $index->addMessage(l("Internal Error"), "warning");
            break;
    }
}
$text = "<strong>Thank you for testing OrongoCMS!</strong><br/><br/>";
$text .= "<p>To check for updates go to <a href='" . orongoURL("orongo-admin/orongo-update-check.php") . "'>the update checker</a>.";
$text .= "<br/>Found bugs? Please post them <a href='" . orongoURL("orongo-admin/post-issue.php") . "'>here</a>.";
$text .= "<br/>You can find the terminal of your OrongoCMS installation <a href='" . OrongoURL("orongo-admin/terminal.php") . "'>here</a>.";
$text .= "<br/><br/>Enjoy OrongoCMS,<br/> ";
$text .= "<strong>The OrongoCMS Team</strong>";
$index->addObject(new AdminFrontendObject(100, "Info", $text, null, false));
$index->render();
示例#2
0
            $msg = l("LOGIN_MSG_INVALID_ACTIVATION_URL");
            $msgtype = "warning";
            break;
        case 5:
            $msg = l('LOGIN_MSG_ALREADY_ACTIVATED');
            $msgtype = "info";
            break;
        case 6:
            $msg = l('LOGIN_MSG_ACTIVATION_OK');
            $msgtype = "success";
            break;
        case 7:
            $msg = l("LOGIN_MSG_PROMPT_ACTIVATION");
            $msgtype = "warning";
            break;
        default:
            break;
    }
}
$login = new AdminFrontend();
$login->main(array("time" => time(), "page_title" => "Login", "page_template" => "ndashboard"));
$form = new AdminFrontendForm(75, "Login", "POST", orongoURL("actions/action_Login.php"));
$form->addInput("Username", "username", "text");
$form->addInput("Password", "password", "password");
$form->addButton("Login", true);
$login->addObject($form);
$login->addObject(new AdminFrontendObject(25, "", '<h4>' . l("New here") . '</h4><p>' . l("Register text", array('<a href="' . orongoURL("orongo-register.php#") . '">', '</a>')) . '</p>'));
if ($msg != null) {
    $login->addMessage($msg, $msgtype);
}
$login->render();
示例#3
0
if (getUser()->getRank() < RANK_WRITER) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
$manage = new AdminFrontend();
$manage->main(array("time" => time(), "page_title" => "Manage", "page_template" => "dashboard"));
if (!isset($_SERVER['QUERY_STRING'])) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
    exit;
}
$object = $_SERVER['QUERY_STRING'];
if (isset($_GET['msg']) && isset($_GET['obj'])) {
    $object = $_GET['obj'];
    switch ($_GET['msg']) {
        case 0:
            $manage->addMessage(l("Object not exists"), "error");
            break;
        case 1:
            $manage->addMessage(l("Object delete success"), "success");
            break;
        case 2:
            $manage->addMessage(l("Object delete error"), "error");
            break;
        case 3:
            $manage->addMessage(l("Plugin installed"), "success");
            break;
        case 4:
            $manage->addMessage(l("Plugin deinstalled"), "success");
            break;
        case 5:
            $manage->addMessage(l("Plugin settings saved"), "success");
示例#4
0
require '../startOrongo.php';
startOrongo('admin_plugin-uninstall');
Security::promptAuth();
if (getUser()->getRank() != RANK_ADMIN) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
if (!isset($_GET['xml_path'])) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
    exit;
}
$xmlPath = ADMIN . '/plugins' . urldecode($_GET['xml_path']);
$install = new AdminFrontend();
$install->main(array("time" => time(), "page_title" => "Uninstall", "page_template" => "dashboard"));
if (!file_exists($xmlPath)) {
    $install->addMessage(l("Plugin not found"), "error");
    $install->render();
    exit;
}
$installed = false;
foreach (getPlugins() as $plugin) {
    if ($plugin instanceof OrongoPluggableObject == false) {
        continue;
    }
    if ($plugin->getInfoPath() == $xmlPath) {
        $installed = true;
    }
}
if (!$installed) {
    $install->addMessage(l("Plugin not installed"), "warning");
    $install->render();
示例#5
0
    exit;
}
if (!isset($_SERVER['QUERY_STRING'])) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
    exit;
}
$object = $_SERVER['QUERY_STRING'];
$create = new AdminFrontend();
$create->main(array("time" => time(), "page_title" => "Create", "page_template" => "dashboard"));
if (isset($_GET['msg'])) {
    if (isset($_GET['obj'])) {
        $object = $_GET['obj'];
    }
    switch ($_GET['msg']) {
        case 0:
            $create->addMessage(l("Object post error"), "error");
            break;
        case 1:
            $create->addMessage(l("Object post success"), "success");
            break;
        default:
            break;
    }
}
switch ($object) {
    case "article":
        $create->setTitle("Create Article");
        $form = new AdminFrontendForm(100, "New Article", "POST", orongoURL("actions/action_Create.php?article"));
        $form->addInput("Article Title", "title", "text", "", true);
        $form->addInput("Article Content", "content", "ckeditor", "", true);
        $form->addInput("Tags", "tags", "text", "tag1, tag2");
示例#6
0
$postIssue = new AdminFrontend();
getDisplay()->addHTML('<script src="' . orongoURL("js/ajax.boolean.js") . '" type="text/javascript"></script>');
if (isset($_GET['token'])) {
    $_SESSION["auth-sub-token"] = $_GET['token'];
    getDisplay()->closeWindow();
    exit;
}
if (!isset($_SESSION["auth-sub-token"])) {
    $postIssue->main(array("time" => time(), "page_title" => "Login to Google", "page_template" => "dashboard"));
    $postIssue->addObject(new AdminFrontendObject(100, "Logging in to Google", l("Waiting for login") . "<br/><br/><br/><strong>" . l("Do not see popup") . "</strong><br/>" . l("Enable popups")));
    $js = 'window.setInterval(function() {';
    $js .= 'if(getAjaxBool("' . orongoURL("ajax/isGCSet.php") . '")) window.location="' . orongoURL("orongo-admin/post-issue.php") . '"; ';
    $js .= '},2000);';
    getDisplay()->addJS($js, "document.ready");
    if (isset($_GET['error'])) {
        $postIssue->addMessage($_GET['error'], "error");
    }
    if (isset($_GET['msg'])) {
        switch ($_GET['msg']) {
            case 0:
                $postIssue->addMessage(l("Issue posted"), "success");
                break;
            default:
                break;
        }
    } else {
        $windowJS = "var login = window.open('" . IssueTracker::getAuthSubRequestUrl(orongoURL("orongo-admin/post-issue.php")) . "');";
        getDisplay()->addJS($windowJS, "document.ready");
    }
    $postIssue->render();
} else {
示例#7
0
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_view');
Security::promptAuth();
$view = new AdminFrontend();
if (isset($_GET['msg'])) {
    if (!isset($_GET['id']) || !isset($_GET['obj'])) {
        header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
        exit;
    }
    $id = trim($_GET['id']);
    $object = trim($_GET['obj']);
    switch ($_GET['msg']) {
        case 1:
            $view->addMessage(l("Object edit success"), "success");
            break;
        case 0:
            $view->addMessage(l("Object edit error"), "error");
            break;
        default:
            break;
    }
} else {
    $query = explode(".", trim($_SERVER['QUERY_STRING']));
    if (count($query) != 2) {
        header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
        exit;
    }
    $object = trim($query[0]);
    $id = trim($query[1]);
if (getUser()->getRank() != RANK_ADMIN) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
$updater = new AdminFrontend();
$updater->main(array("time" => time(), "page_title" => "Update Checker", "page_template" => "dashboard"));
$isUpdateAvailable = false;
try {
    $isUpdateAvailable = OrongoUpdateChecker::isUpdateAvailable();
} catch (Exception $e) {
    $msgbox = new MessageBox(l("Error update check"));
    $msgbox->bindException($e);
    getDisplay()->addObject($msgbox);
}
if ($isUpdateAvailable) {
    $updater->addMessage(l("Update available"), "success");
    $info = null;
    try {
        $info = OrongoUpdateChecker::getLatestVersionInfo();
    } catch (Exception $e) {
        $msgbox = new MessageBox("Error occured while checking for update");
        $msgbox->bindException($e);
        getDisplay()->addObject($msgbox);
        break;
    }
    if ($info->critical) {
        $updater->addMessage(l("Critical update"), "warning");
    }
    $updater->addObject(new AdminFrontendObject(100, "How to update", l("Ready to update to", "r" . $info->latest_version) . '<br/>' . l("Visit for update information", "<a href='" . $info->update_url . "'>" . str_replace("http://", "", $info->update_url) . "</a>")));
} else {
    $updater->addMessage(l("No update"), "info");
示例#9
0
            $msgtype = "warning";
            break;
        case 2:
            $msg = l("REG_MSG_USERNAME_TOO_SHORT");
            $msgtype = "error";
            break;
        case 3:
            $msg = l("REG_MSG_PASSWORD_TOO_SHORT");
            $msgtype = "error";
            break;
        case 4:
            $msg = l("REG_MSG_FILL_IN_USERNAME");
            $msgtype = "error";
            break;
        default:
            break;
    }
}
$register = new AdminFrontend();
$register->main(array("time" => time(), "page_title" => "Register", "page_template" => "ndashboard"));
$form = new AdminFrontendForm(100, "Register", "POST", orongoURL("actions/action_Register.php"));
$form->addInput("Username", "username", "text", "", true);
$form->addInput("Password", "password", "password", "", true);
$form->addInput("Password again", "password_again", "password", "", true);
$form->addInput("Email", "email", "email", "", true);
$form->addButton("Register", true);
$register->addObject($form);
if ($msg != null) {
    $register->addMessage($msg, $msgtype);
}
$register->render();
示例#10
0
         exit;
     }
     $delete->setTitle("Delete User");
     try {
         $user = new User($id);
     } catch (Exception $e) {
         if ($e->getCode() == USER_NOT_EXIST) {
             header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=users"));
             exit;
         } else {
             header("Location: " . orongoURL("orongo-admin/index.php?msg=2"));
             exit;
         }
     }
     if (getUser()->getID() == $user->getID()) {
         $delete->addMessage(l("Can not delete yourself"), "error");
         $delete->render();
         exit;
     }
     $form = new AdminFrontendForm(100, l("Delete User") . " (" . $user->getID() . ")", "POST", "", false);
     $form->addButton("Yes", true, orongoURL("actions/action_Delete.php?user." . $user->getID()));
     $form->addButton("No", false, orongoURL("orongo-admin/manage.php?users"));
     $form->setContent(l("Sure delete user", $user->getName()));
     $delete->addObject($form);
     $delete->render();
     break;
 case "page":
     if (getUser()->getRank() < RANK_WRITER) {
         header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
         exit;
     }
示例#11
0
/**
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_orongo-settings');
Security::promptAuth();
if (getUser()->getRank() != RANK_ADMIN) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
$settings = new AdminFrontend();
if (isset($_GET['msg'])) {
    switch ($_GET['msg']) {
        case 0:
            $settings->addMessage(l("Settings saved"), "success");
        default:
            break;
    }
}
$settings->main(array('time' => time(), 'page_title' => 'Orongo Settings', 'page_template' => 'dashboard'));
$settingForm = new AdminFrontendForm(100, "Orongo Settings", "POST", orongoURL("actions/action_SaveOrongoSettings.php"));
$settingForm->addInput("Website Name", "website_name", "text", Settings::getWebsiteName());
$settingForm->addInput("Website URL", "website_url", "text", Settings::getWebsiteURL());
$settingForm->addInput("Admin Email", "admin_email", "text", Settings::getEmail());
$currentShowArchiveString = Settings::showArchive() ? l("Yes") : l("No");
$settingForm->addRadios("Show archive", "show_archive", array(l("Yes") => "true", l("No") => "false"), $currentShowArchiveString);
$languages = array(Settings::getLanguageName() => "nl_NL");
$files = @scandir(ADMIN . '/lang/');
if (is_array($files)) {
    foreach ($files as $file) {
示例#12
0
require '../startOrongo.php';
startOrongo('admin_plugin-settings');
Security::promptAuth();
if (getUser()->getRank() != RANK_ADMIN) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
if (!isset($_GET['xml_path'])) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
    exit;
}
$xmlPath = ADMIN . '/plugins' . urldecode($_GET['xml_path']);
$settings = new AdminFrontend();
$settings->main(array("time" => time(), "page_title" => "Plugin Setting", "page_template" => "dashboard"));
if (!file_exists($xmlPath)) {
    $settings->addMessage(l("Plugin not found"), "error");
    $settings->render();
    exit;
}
$installed = false;
foreach (getPlugins() as $plugin) {
    if ($plugin instanceof OrongoPluggableObject == false) {
        continue;
    }
    if ($plugin->getInfoPath() == $xmlPath) {
        $installed = true;
    }
}
if (!$installed) {
    $settings->addMessage(l("Plugin not installed"), "warning");
    $settings->render();