Beispiel #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();
Beispiel #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();
Beispiel #3
0
<?php

/**
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_manage');
Security::promptAuth();
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;
<?php

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) {
Beispiel #5
0
/**
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_create');
Security::promptAuth();
if (getUser()->getRank() < RANK_WRITER) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=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;
    }
Beispiel #6
0
require '../startOrongo.php';
startOrongo('admin_media');
Security::promptAuth();
if (getUser()->getRank() != RANK_ADMIN) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
if (isset($_SERVER['QUERY_STRING'])) {
    $type = $_SERVER['QUERY_STRING'];
} else {
    $type = null;
}
$types = array("files", "images");
if ($type != null) {
    if (!in_array($type, $types)) {
        $type = null;
    }
    $type = strtoupper(substr($type, 0, 1)) . substr($type, 1);
    $pageTitle = "Gallery";
}
if ($type == null) {
    $pageTitle = "Media";
}
$media = new AdminFrontend();
$media->main(array("time" => time(), "page_title" => $pageTitle, "page_template" => "dashboard"));
$ckfinder = new CKFinder(orongoURL("lib/ckfinder/"));
if ($type != null) {
    $ckfinder->ResourceType = $type;
}
$media->addObject(new AdminFrontendObject(100, l("Media Manager") . " - " . l("Powered by") . " CKFinder", $ckfinder->CreateHTML(), null, false));
$media->render();
Beispiel #7
0
<?php

/**
 * @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;
<?php

/**
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_orongo-update-check');
Security::promptAuth();
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);
Beispiel #9
0
<?php

/**
 * @author Jaco Ruit
 */
require '../startOrongo.php';
startOrongo('admin_post-issue');
Security::promptAuth();
if (getUser()->getRank() < RANK_ADMIN) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
    exit;
}
$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']) {
Beispiel #10
0
 */
require '../startOrongo.php';
startOrongo('admin_edit');
Security::promptAuth();
if (!isset($_SERVER['QUERY_STRING'])) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
    exit;
}
$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]);
$create = new AdminFrontend();
$create->main(array("time" => time(), "page_title" => "Edit", "page_template" => "dashboard"));
switch ($object) {
    case "article":
        if (getUser()->getRank() < RANK_WRITER) {
            header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
            exit;
        }
        $create->setTitle("Edit Article");
        try {
            $article = new Article($id);
        } catch (Exception $e) {
            if ($e->getCode() == ARTICLE_NOT_EXIST) {
                header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=articles"));
                exit;
            } else {
Beispiel #11
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();
Beispiel #12
0
 */
require '../startOrongo.php';
startOrongo('admin_delete');
Security::promptAuth();
if (!isset($_SERVER['QUERY_STRING'])) {
    header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
    exit;
}
$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]);
$delete = new AdminFrontend();
$delete->main(array("time" => time(), "page_title" => "Delete", "page_template" => "dashboard"));
switch ($object) {
    case "article":
        if (getUser()->getRank() < RANK_WRITER) {
            header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
            exit;
        }
        $delete->setTitle("Delete Article");
        try {
            $article = new Article($id);
        } catch (Exception $e) {
            if ($e->getCode() == ARTICLE_NOT_EXIST) {
                header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=articles"));
                exit;
            } else {
Beispiel #13
0
<?php

/**
 * @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)) {
Beispiel #14
0
 * @author Jaco Ruit
 */
define('HACK_PLUGINS', true);
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;
    }
}