Esempio n. 1
0
function customize_theme_button()
{
    if (is_demo() && !is_theme_customize() && !current_user_can('administrator')) {
        echo '<div class="options-panel-closed hidden-phone hidden-tablet" style="display: block;">';
        echo '<a target="_parent" href="/demo-login.php" title="Customize the theme">';
        echo '<span class="customize">';
        echo 'Click here<br />to customize<br />the theme</span>';
        echo '<img src="' . get_template_directory_uri() . '/images/tools-white.png" width="64" alt="Customize" title="Customize" />';
        echo '</a></div>';
    }
}
Esempio n. 2
0
 public function lang_del()
 {
     $langId = (int) getRequest('param0');
     $langs = langsCollection::getInstance();
     if (sizeof($langs->getList()) == 1) {
         throw new publicAdminException(getLabel('error-minimum-one-lang-required'));
     }
     if ($langs->getDefaultLang()->getId() == $langId) {
         throw new publicAdminException(getLabel('error-try-delete-default-language'));
     }
     $cmsController = cmsController::getInstance();
     $currentLangId = $cmsController->getCurrentLang()->getId();
     $url = '/admin/config/langs/';
     if ($currentLangId != $langId) {
         $url = $this->pre_lang . $url;
     }
     if (!is_demo()) {
         $langs->delLang($langId);
     }
     $this->chooseRedirect($url);
 }
Esempio n. 3
0
 public function mails()
 {
     $regedit = regedit::getInstance();
     $params = array("mails" => array("email:admin_email" => NULL, "string:email_from" => NULL, "string:fio_from" => NULL));
     $mode = getRequest("param0");
     if ($mode == "do") {
         $params = $this->expectParams($params);
         if (!is_demo()) {
             $regedit->setVar("//settings/admin_email", $params['mails']['email:admin_email']);
             $regedit->setVar("//settings/email_from", $params['mails']['string:email_from']);
             $regedit->setVar("//settings/fio_from", $params['mails']['string:fio_from']);
         }
         $this->chooseRedirect();
     }
     $params['mails']['email:admin_email'] = $regedit->getVal("//settings/admin_email");
     $params['mails']['string:email_from'] = $regedit->getVal("//settings/email_from");
     $params['mails']['string:fio_from'] = $regedit->getVal("//settings/fio_from");
     $this->setDataType("settings");
     $this->setActionType("modify");
     $data = $this->prepareData($params, "settings");
     $this->setData($data);
     return $this->doData();
 }
Esempio n. 4
0
<?php

if (is_demo()) {
    ?>
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <h3>You are in demo mode.</h3>
            <p>To login as admin, use: <b>admin / admin</b></p>
        </div>
    </nav>
<?php 
}
?>

<div class="wrapper">
  <form class="form-signin" method="POST">
    <h2 class="form-signin-heading">Please login</h2>
    <input type="text" class="form-control" name="username" placeholder="Username" required="" autofocus="" autocomplete="off"/>
    <input type="password" class="form-control" name="password" placeholder="Password" required="" autocomplete="off"/>
    <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>   
  </form>
</div>

<style>
.wrapper {
    margin-top: 10px;
}
    
.form-signin {
  max-width: 380px;
  padding: 15px 35px 45px;
Esempio n. 5
0
        if ((is_post() || $_REQUEST['action'] == 'delete') && $_REQUEST['id'] == 1) {
            \Meta\Core\Flash::error(t('Sorry, but you cannot modify the Admin user in demo mode'));
            redirect('manage-users');
        }
    }
    // convert new password to md5 on "users" table
    // this can filled on user edit form
    if (is_post() && isset($_REQUEST['id']) && isset($_REQUEST['password_new']) && strlen($_REQUEST['password_new']) > 0) {
        \Meta\Core\Db::execute('UPDATE users SET password = md5(?) WHERE id = ?', array($_REQUEST['password_new'], $_REQUEST['id']));
    }
    return $page;
});
Page::beforeRender('frame-user-groups', function ($page) {
    // modify $page array here
    // prevent unauthorized actions
    if (is_demo() && isset($_REQUEST['action']) && isset($_REQUEST['id'])) {
        if (is_post() || $_REQUEST['action'] == 'delete') {
            $user_id = \Meta\Core\Db::query('SELECT user_id FROM user_groups WHERE id = ?', array($_REQUEST['id']))->fetchColumn();
            if ($user_id == 1) {
                \Meta\Core\Flash::error(t('Sorry, but you cannot modify the Admin user in demo mode'));
                header("Location: " . urldecode($_GET['url_from']));
                exit;
            }
        }
    }
    return $page;
});
Page::beforeRender('manage-files', function ($page) {
    // scan all files. if the number is different than the table, then re populate all entirely table
    $files = \Meta\Core\FileSystem::listAll();
    $dbCountFiles = \Meta\Core\Db::query('SELECT COUNT(*) FROM files')->fetchColumn();
Esempio n. 6
0
 public function rename()
 {
     $this->flushAsXml('rename');
     $path = CURRENT_WORKING_DIR . base64_decode(getRequest("oldName"));
     $newName = dirname($path) . "/" . basename(base64_decode(getRequest("newName")));
     $old = getPathInfo($path);
     $new = getPathInfo($newName);
     if (strtolower($old['extension']) != strtolower($new['extension'])) {
         return array();
     }
     $oldDir = str_replace('\\', '/', $old['dirname']);
     $newDir = str_replace('\\', '/', $new['dirname']);
     if (strpos($newDir, CURRENT_WORKING_DIR . '/images') === false && strpos($newDir, CURRENT_WORKING_DIR . '/files') === false && strpos($oldDir, CURRENT_WORKING_DIR . '/images') === false && strpos($oldDir, CURRENT_WORKING_DIR . '/files') === false) {
         return array();
     }
     if (!is_demo()) {
         rename($path, $newName);
     } else {
         $newName = $path;
     }
     return array('attribute:path' => substr($newName, strlen(CURRENT_WORKING_DIR)));
 }
echo $string['availablemarks'];
?>
</div>
<div style="left:155px; top:-9px" class="label"><?php 
echo $string['studentsmark'];
?>
</div>
<div style="left:60px; top:-9px; width:160px" class="label"><?php 
echo $string['medianclassmark'];
?>
</div>
</div>

<div style="position:absolute; top:0; left:0; width:100%">
<?php 
$demo = is_demo($userObject);
$student_details = UserUtils::get_user_details($userID, $mysqli);
$name = demo_replace($student_details['title'], $demo) . ' ' . demo_replace($student_details['surname'], $demo) . ', ' . demo_replace($student_details['first_names'], $demo) . ' (' . demo_replace($student_details['student_id'], $demo) . ')';
echo "<table class=\"header\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"font-size:90%\">\n";
echo "<tr><th><div style=\"padding-left:10px; font-size:200%; font-weight:bold\">" . $propertyObj->get_paper_title() . "</div><div style=\"padding-left:10px\">{$name}</div></th></tr>\n";
echo "</table>\n<ol>";
// Get the questions on the paper
$q_no = 1;
$result = $mysqli->prepare("SELECT q_id, theme, leadin, q_type FROM questions, papers WHERE papers.paper = ? AND papers.question = questions.q_id AND q_type != 'info' ORDER BY screen, display_pos");
$result->bind_param('i', $paperID);
$result->execute();
$result->bind_result($q_id, $theme, $leadin, $q_type);
while ($result->fetch()) {
    echo "<li>{$leadin}";
    if (substr(strtolower($leadin), -4) == '</p>') {
    } elseif (substr(strtolower($leadin), -6) == '</div>') {
Esempio n. 8
0
 public function del_module()
 {
     $restrictedModules = array('config', 'content', 'users', 'data');
     $target = getRequest('param0');
     if (in_array($target, $restrictedModules)) {
         throw new publicAdminException(getLabel("error-can-not-delete-{$target}-module"));
     }
     $module = cmsController::getInstance()->getModule($target);
     if (!is_demo()) {
         if ($module instanceof def_module) {
             $module->uninstall();
         }
         if ($target == 'geoip') {
             self::switchGroupsActivity('city_targeting', false);
         }
     }
     $this->chooseRedirect($this->pre_lang . "/admin/config/modules/");
 }
Esempio n. 9
0
function demo_check()
{
    // demo protection
    if (is_demo()) {
        \Meta\Flash::warning(demo_msg());
        redirect(current_path());
    }
}
Esempio n. 10
0
 /**
  * TODO PHPDoc
  * Enter description here ...
  */
 public function restoreSnapshot()
 {
     $buffer = outputBuffer::current();
     $buffer->contentType('text/javascript');
     $buffer->charset('utf-8');
     $buffer->clear();
     $buffer->option('comression', false);
     $location = $this->pre_lang . '/admin/backup/backup_copies/';
     if (defined("CURRENT_VERSION_LINE") && false) {
         if (is_demo()) {
             $err = getLabel('error-disabled-in-demo');
             $buffer->push("alert('{$err}');window.location = '{$location}';");
             $buffer->end();
         }
     }
     /*			if($res = manifest::unhibernate('RestoreSystemBackup')) {
     				echo $res;
     			} else {*/
     $mcfg = new baseXmlConfig(SYS_KERNEL_PATH . "subsystems/manifest/manifests/RestoreSystemBackup.xml");
     $manifest = new manifest($mcfg);
     $manifest->hibernationsCountLeft = -1;
     $manifest->addParam('external-archive-filepath', getRequest('filename'));
     $manifest->setCallback(new jsonManifestCallback());
     $manifest->execute();
     //}
     echo '';
     $buffer->push("\nwindow.location = '{$location}';\n");
     $buffer->end();
     exit;
 }
Esempio n. 11
0
 public function config()
 {
     $regedit = regedit::getInstance();
     $params = array("config" => array("int:max-days-storing-events" => null, "boolean:collect-events" => null));
     $mode = getRequest("param0");
     if ($mode == "do") {
         if (!is_demo()) {
             $params = $this->expectParams($params);
             $regedit->setVar("//modules/events/max-days-storing-events", (int) $params["config"]["int:max-days-storing-events"]);
             $regedit->setVar("//modules/events/collect-events", (int) $params["config"]["boolean:collect-events"]);
             $this->chooseRedirect();
         }
     }
     $params["config"]["int:max-days-storing-events"] = (int) $regedit->getVal("//modules/events/max-days-storing-events");
     $params["config"]["boolean:collect-events"] = (bool) $regedit->getVal("//modules/events/collect-events");
     $this->setDataType("settings");
     $this->setActionType("modify");
     $data = $this->prepareData($params, "settings");
     $this->setData($data);
     return $this->doData();
 }
Esempio n. 12
0
 public function config()
 {
     $vb1444fb0c07653567ad325aa25d4e37a = regedit::getInstance();
     $v21ffce5b8a6cc8cc6a41448dd69623c9 = array("config" => array("int:max-days-storing-events" => null, "boolean:collect-events" => null));
     $v15d61712450a686a7f365adf4fef581f = getRequest("param0");
     if ($v15d61712450a686a7f365adf4fef581f == "do") {
         if (!is_demo()) {
             $v21ffce5b8a6cc8cc6a41448dd69623c9 = $this->expectParams($v21ffce5b8a6cc8cc6a41448dd69623c9);
             $vb1444fb0c07653567ad325aa25d4e37a->setVar("//modules/events/max-days-storing-events", (int) $v21ffce5b8a6cc8cc6a41448dd69623c9["config"]["int:max-days-storing-events"]);
             $vb1444fb0c07653567ad325aa25d4e37a->setVar("//modules/events/collect-events", (int) $v21ffce5b8a6cc8cc6a41448dd69623c9["config"]["boolean:collect-events"]);
             $this->chooseRedirect();
         }
     }
     $v21ffce5b8a6cc8cc6a41448dd69623c9["config"]["int:max-days-storing-events"] = (int) $vb1444fb0c07653567ad325aa25d4e37a->getVal("//modules/events/max-days-storing-events");
     $v21ffce5b8a6cc8cc6a41448dd69623c9["config"]["boolean:collect-events"] = (bool) $vb1444fb0c07653567ad325aa25d4e37a->getVal("//modules/events/collect-events");
     $this->setDataType("settings");
     $this->setActionType("modify");
     $v8d777f385d3dfec8815d20f7496026dc = $this->prepareData($v21ffce5b8a6cc8cc6a41448dd69623c9, "settings");
     $this->setData($v8d777f385d3dfec8815d20f7496026dc);
     return $this->doData();
 }
Esempio n. 13
0
 public function domain_del()
 {
     $domain_id = (int) getRequest('param0');
     if (!is_demo()) {
         domainsCollection::getInstance()->delDomain($domain_id);
     }
     $this->chooseRedirect($this->pre_lang . '/admin/config/domains/');
 }
Esempio n. 14
0
 public function __construct($studentsonly, $percent, $ordering, $absent, $sortby, $userObject, $propertyObj, $startdate, $enddate, $repcourse, $repmodule, $db, $string)
 {
     $this->db = $db;
     $this->demo = is_demo($userObject);
     $this->paperID = $propertyObj->get_property_id();
     $this->paper_type = $propertyObj->get_paper_type();
     $this->calendar_year = $propertyObj->get_calendar_year();
     $this->startdate = $startdate;
     $this->enddate = $enddate;
     $this->absent = $absent;
     $this->studentsonly = $studentsonly;
     $this->marking = $propertyObj->get_marking();
     $this->percent = $percent;
     $this->ordering = $ordering;
     $this->sortby = $sortby;
     $this->repcourse = $repcourse;
     $this->repmodule = $repmodule;
     $this->pass_mark = $propertyObj->get_pass_mark();
     $this->distinction_mark = $propertyObj->get_distinction_mark();
     $this->log_late = array();
     $this->q_medians = array();
     $this->random_q_ids = array();
     $this->config = Config::get_instance();
     $this->propertyObj = $propertyObj;
     $this->exclusions = new Exclusion($this->paperID, $this->db);
     $this->display_excluded = '';
     $this->user_no = 0;
     $this->marking_overrides = array();
     $this->string = $string;
     $unmarked_calculation = false;
     $unmarked_textbox = false;
     $this->question_statuses = QuestionStatus::get_all_statuses($db, array(), true);
 }
Esempio n. 15
0
<?php

/**
 * Petrichor
 * (c) Web factory Ltd, 2013
 */
define('WF_THEME_NAME', 'Petrichor');
define('WF_THEME_VERSION', '1.35');
define('WF_THEME_TEXTDOMAIN', 'wf_petrichor');
require_once get_template_directory() . '/admin/common-functions.php';
if (is_demo() && file_exists(get_template_directory() . '/admin/demo-setup.php') && !current_user_can('administrator')) {
    require_once get_template_directory() . '/admin/demo-setup.php';
} else {
    define('WF_THEME_OPTIONS', 'pe_theme_options');
}
require_once get_template_directory() . '/admin/theme-customize.php';
require_once get_template_directory() . '/admin/shortcodes.php';
require_once get_template_directory() . '/admin/widgets.php';
require_once get_template_directory() . '/admin/simple-page-ordering.php';
if (!version_compare(get_bloginfo('version'), 3.4, '>=')) {
    if (is_admin()) {
        add_action('admin_notices', 'wf_theme_min_version_notice');
    } else {
        echo '<p>' . __('<b>' . WF_THEME_NAME . '</b> theme requires <b>WordPress v3.4</b> or higher to function properly. Please upgrade.', WF_THEME_TEXTDOMAIN) . '</p>';
        die;
    }
}
if (!isset($content_width)) {
    $content_width = 900;
}
$wf_theme_js_vars = array('ajaxurl' => admin_url('admin-ajax.php'), 'theme_folder' => get_template_directory_uri(), 'theme_options' => WF_THEME_OPTIONS, 'is_home' => (int) (is_home() || is_front_page()), 'newsletter_msg_ok' => wf_theme_get_option('newsletter_msg_ok'), 'slider_pause' => wf_theme_get_option('slider_pause'), 'slider_pause_hover' => wf_theme_get_option('slider_pause_hover'), 'slider_controls' => wf_theme_get_option('slider_controls'), 'slider_animation' => wf_theme_get_option('slider_animation'), 'contact_form_msg_ok' => wf_theme_get_option('contact_form_msg_ok'), 'twitter_feed' => wf_theme_get_option('twitter_feed'));