Example #1
0
 function doAction()
 {
     $action = getaction();
     //если есть экшин- выполняем
     if (file_exists(__corePath . "actions/{$action}.php")) {
         include __corePath . "actions/{$action}.php";
         $action = new action($this->db);
         $action->execute();
     }
 }
Example #2
0
/**
 * inserts a new idea in the database
 *
 * @param  string    $title  title of the idea
 * @param  string    $message message of the idea
 * @param  string    $anonymization tells if idea is to be anonymized
 * @param  integer   $category id of the category for the idea
 * @param  string    $login  login of the poster
 * @param  integer   $valid says if the idea needs to be moderated (default 0 = needs moderation)
 * @return array     
 */
function post($title, $message, $anonymization, $category, $login, $valid = 0)
{
    $action = new action();
    $action->result = False;
    $check_1 = isset($title) && !empty($title);
    $check_2 = isset($message) && !empty($message);
    $check_3 = !isset($anonymization) || $anonymization == "on";
    $check_4 = isset($category) && is_numeric($category) && $category > 0;
    // V�rification des arguments
    if ($check_1) {
        $title_prec = $title;
    } else {
        $action->add_warning(_('Titre incorrect'));
    }
    if ($check_2) {
        $text_prec = $message;
    } else {
        $action->add_warning(_('Message incorrect'));
    }
    if ($check_3) {
        if (isset($anonymization)) {
            $anon_prec = "on";
        }
    } else {
        $action->add_warning(_('Incorrect anonymization value'));
    }
    if ($check_4) {
        $cate_prec = $category;
    } else {
        $action->add_warning(_('Catégorie incorrecte'));
    }
    if ($check_1 && $check_2 && $check_3 && $check_4) {
        $title_prec_sec = mysql_real_escape_string($title_prec);
        $text_prec_sec = mysql_real_escape_string($text_prec);
        $cate_prec_sec = mysql_real_escape_string($cate_prec);
        $rand_prop = mt_rand(0, 65535);
        $hash_prop = sha1($login . $rand_prop);
        if ($anon_prec == "on") {
            $name_print = "";
        } else {
            $name_print = mysql_real_escape_string(construct_name_from_session());
        }
        if (@mysql_query("INSERT INTO `thread` (`thread_id`,`rand_prop`,`hash_prop`,`title`,`text`,`date`,`category`,`is_valid`,`possibly_name`) VALUES (NULL, '{$rand_prop}', '{$hash_prop}','{$title_prec_sec}','{$text_prec_sec}',CURRENT_TIMESTAMP,'{$cate_prec_sec}',{$valid},'{$name_print}')")) {
            $action->add_success(_('Ta proposition a bien été ajoutée et est en attente de modération'));
            $action->result = True;
        } else {
            $action->add_warning(_('Ta proposition n\'a pas pu être ajoutée suite à une erreur de transfert.'));
        }
    }
    return $action;
}
Example #3
0
 public function __construct()
 {
     parent::__construct();
     ignore_user_abort(true);
     set_time_limit(0);
     require APP_PATH . 'model/functions.php';
 }
  function perform(&$request, &$response)
  {
    parent :: perform($request, $response);

    $full_page_cache_manager = new full_page_cache_manager();
    $partial_page_cache_manager = new partial_page_cache_manager();
    $image_cache_manager = new image_cache_manager();

    $full_page_cache_size = $this->_format_size($full_page_cache_manager->get_cache_size());
    $this->view->set('full_page_cache_size', $full_page_cache_size);

    $partial_page_cache_size = $this->_format_size($partial_page_cache_manager->get_cache_size());
    $this->view->set('partial_page_cache_size', $partial_page_cache_size);

    $image_cache_size = $this->_format_size($image_cache_manager->get_cache_size());
    $this->view->set('image_cache_size', $image_cache_size);

    $template_cache_size = $this->_format_size($this->_get_template_cache_size());
    $this->view->set('template_cache_size', $template_cache_size);

    $general_cache_size = $this->_format_size($this->_get_general_cache_size());
    $this->view->set('general_cache_size', $general_cache_size);

    $ini_cache_size = $this->_format_size($this->_get_ini_cache_size());
    $this->view->set('ini_cache_size', $ini_cache_size);
  }
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->init();
     $this->view_header();
     $this->view_footer();
 }
 function perform()
 {
     $chat_room_data =& fetch_mapped_by_url();
     session::destroy('last_message_ids');
     setcookie('chat_room_id', $chat_room_data['object_id'], time() + 365 * 24 * 3600);
     chat_user::enter_chat_room($chat_room_data['object_id']);
     return parent::perform();
 }
Example #7
0
 public function __construct()
 {
     parent::__construct();
     require APP_PATH . 'model/functions.php';
     if (!$this->model('login')->checklogin()) {
         header('Location: ' . url('admin/login'));
         exit;
     }
     $args = $_GET;
     $url = $args['c'] . '/' . $args['a'];
     unset($args['set_lang']);
     unset($args['c']);
     unset($args['a']);
     $query = http_build_query($args);
     $this->view['current_url_lang'] = url($url . '?' . ($query ? $query . '&' : '') . 'set_lang=');
     $m_id = $_SESSION['m_id'];
     $rs = $this->db->table('admin')->where("id={$m_id}")->get();
     $this->view['username'] = $rs['name'];
     $languages =& $this->model('common')->languages();
     if ($_GET['set_lang']) {
         $lang = trim($_GET['set_lang']);
         cookie('admin_lang', $lang);
     } elseif (!cookie('admin_lang')) {
         //main language
         $lang = $this->model('common')->main_lang();
         cookie('admin_lang', $lang);
     } else {
         $lang = cookie('admin_lang');
         $check = 0;
         foreach ($languages as $v) {
             if ($lang == $v['code']) {
                 $check = 1;
                 break;
             }
         }
         if ($check == 0) {
             $lang = $this->model('common')->main_lang();
             cookie('admin_lang', $lang);
         }
     }
     $GLOBALS['config']['LAN_NAME'] = $lang;
     $this->view['lang'] = $lang;
     $this->view['select_lang'] = $languages;
     //default_cur
     $this->view['main_cur'] = $this->model('common')->main_cur();
     $this->view['current_symbol'] =& $this->model('common')->current_symbol();
     //weight_unit
     $this->view['weight_unit'] = $this->model('common')->weight_unit();
     //error_report
     if (MODULE != 'report') {
         $n = $this->db->table('error_report')->where('status=0')->count();
         if ($n > 0) {
             $this->view['error_num'] = $n;
             $this->view['error_msg'] = $this->db->table('error_report')->order('time desc')->getval('message');
         }
     }
 }
 function perform(&$request, &$response)
 {
     $chat_room_data =& fetch_requested_object();
     session::destroy('last_message_ids');
     setcookie('chat_room_id', $chat_room_data['object_id'], time() + 365 * 24 * 3600);
     if ($chat_user_data = chat_user::get_chat_user_data()) {
         if ($chat_user_data['chat_room_id'] != $chat_room_data['object_id']) {
             chat_system::leave_chat_room($chat_user_data['id'], $chat_user_data['nickname'], $chat_user_data['chat_room_id']);
             chat_system::enter_chat_room($chat_user_data['id'], $chat_user_data['nickname'], $chat_room_data['object_id']);
         }
         $this->view->set('nickname', $chat_user_data['nickname']);
     }
     parent::perform(&$request, &$response);
 }
 function perform(&$request, &$response)
 {
     parent::perform($request, $response);
     $full_page_cache_manager = new full_page_cache_manager();
     $partial_page_cache_manager = new partial_page_cache_manager();
     $image_cache_manager = new image_cache_manager();
     $full_page_cache_size = number_format($full_page_cache_manager->get_cache_size() / 1024) . " KB";
     $this->view->set('full_page_cache_size', $full_page_cache_size);
     $partial_page_cache_size = number_format($partial_page_cache_manager->get_cache_size() / 1024) . " KB";
     $this->view->set('partial_page_cache_size', $partial_page_cache_size);
     $image_cache_size = number_format($image_cache_manager->get_cache_size() / 1024) . " KB";
     $this->view->set('image_cache_size', $image_cache_size);
     $template_cache_size = number_format($this->_get_template_cache_size() / 1024) . " KB";
     $this->view->set('template_cache_size', $template_cache_size);
     $ini_cache_size = number_format($this->_get_ini_cache_size() / 1024) . " KB";
     $this->view->set('ini_cache_size', $ini_cache_size);
 }
 function __construct()
 {
     parent::__construct();
     T('user/steadmin');
     //全局获取登录用户数据
     steadmin::getLoginUser();
     //        T('user/permission');
     //        permission::checkPermission(steadmin$adminInfo['groupid']);
     if (!isAjax()) {
         $this->getSysMenu();
         //获取系统菜单
         $this->getAdminMenuSetting();
         //获取帐号个性化菜单设置
     }
     //全局获取当前页面URL
     $this->assign(array('adminInfo' => steadmin::$adminInfo, 'userGroup' => C('steward/admin', 'group')));
     //清除main_path对后台的影响
     G('main_path', null);
 }
Example #11
0
    exit;
}

define('HIDE_TOOL_TITLE', 1);
$guest_allowed = true;

require_once 'include/baseTheme.php';
require_once 'include/CAS/CAS.php';
require_once 'modules/auth/auth.inc.php';
require_once 'include/lib/textLib.inc.php';
require_once 'include/phpass/PasswordHash.php';

// unset system that records visitor only once by course for statistics
require_once 'include/action.php';
if (isset($dbname)) {
    $action = new action();
    $action->record('MODULE_ID_UNITS', 'exit');
}
unset($dbname);

// if we try to login... then authenticate user.
$warning = '';
if (isset($_SESSION['shib_uname'])) {
    // authenticate via shibboleth
    shib_cas_login('shibboleth');
} elseif (isset($_SESSION['cas_uname']) && !isset($_GET['logout'])) {
    // authenticate via cas
    shib_cas_login('cas');
} elseif (isset($_GET['provider'])) {
        //hybridauth authentication (Facebook, Twitter, Google, Yahoo, Live, LinkedIn)
        hybridauth_login();
Example #12
0
 * ========================================================================
 */
$require_current_course = TRUE;
$require_login = TRUE;
$require_help = TRUE;
$helpTopic = 'bbb';
require_once '../../include/baseTheme.php';
require_once 'include/sendMail.inc.php';
// For creating bbb urls & params
require_once 'bbb-api.php';
require_once 'functions.php';
require_once 'include/lib/modalboxhelper.class.php';
ModalBoxHelper::loadModalBox();
/* * ** The following is added for statistics purposes ** */
require_once 'include/action.php';
$action = new action();
$action->record(MODULE_ID_BBB);
/* * *********************************** */
$toolName = $langBBB;
// guest user not allowed
if (check_guest()) {
    $tool_content .= "<div class='alert alert-danger'>{$langNoGuest}</div>";
    draw($tool_content, 2);
}
load_js('tools.js');
load_js('tagsinput');
load_js('bootstrap-datetimepicker');
load_js('validation.js');
$head_content .= "\r\n<script type='text/javascript'>\r\n\$(function() {\r\n\$('#start_session').datetimepicker({\r\n        format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', \r\n        language: '" . $language . "',\r\n        autoclose: true\r\n    });\r\n});\r\n</script>";
load_js('select2');
$head_content .= "<script type='text/javascript'>\r\n    \$(document).ready(function () {\r\n        \$('#select-groups').select2();       \r\n        \$('#selectAll').click(function(e) {\r\n            e.preventDefault();\r\n            var stringVal = [];\r\n            \$('#select-groups').find('option').each(function(){\r\n                stringVal.push(\$(this).val());\r\n            });\r\n            \$('#select-groups').val(stringVal).trigger('change');\r\n        });\r\n        \$('#removeAll').click(function(e) {\r\n            e.preventDefault();\r\n            var stringVal = [];\r\n            \$('#select-groups').val(stringVal).trigger('change');\r\n        });         \r\n    });\r\n\r\n    </script>\r\n";
Example #13
0
function get_footer()
{
    ?>
    <!-- jQuery & Required Scripts -->
    <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
    
    <?php 
    if (!IS_SINGLE && PAGINATION_ON_OFF !== "off") {
        ?>
    <!-- Post Pagination -->
    <script>
        var infinite = true;
        var next_page = 2;
        var loading = false;
        var no_more_posts = false;
        $(function() {
            function load_next_page() {
                $.ajax({
                    url: "index.php?page=" + next_page,
                    beforeSend: function () {
                        $('body').append('<article class="loading-frame"><div class="row"><div class="one-quarter meta"></div><div class="three-quarters"><img src="./templates/<?php 
        echo ACTIVE_TEMPLATE;
        ?>
/loading.gif" alt="Loading"></div></div></article>');
                        $("body").animate({ scrollTop: $("body").scrollTop() + 250 }, 1000);
                    },
                    success: function (res) {
                        next_page++;
                        var result = $.parseHTML(res);
                        var articles = $(result).filter(function() {
                            return $(this).is('article');
                        });
                        if (articles.length < 2) {  //There's always one default article, so we should check if  < 2
                            $('.loading-frame').html('You\'ve reached the end of this list.');
                            no_more_posts = true;
                        }  else {
                            $('.loading-frame').remove();
                            $('body').append(articles);
                        }
                        loading = false;
                    },
                    error: function() {
                        $('.loading-frame').html('An error occurred while loading posts.');
                        //keep loading equal to false to avoid multiple loads. An error will require a manual refresh
                    }
                });
            }

            $(window).scroll(function() {
                var when_to_load = $(window).scrollTop() * 0.32;
                if (infinite && (loading != true && !no_more_posts) && $(window).scrollTop() + when_to_load > ($(document).height()- $(window).height() ) ) {
                    // Sometimes the scroll function may be called several times until the loading is set to true.
                    // So we need to set it as soon as possible
                    loading = true;
                    setTimeout(load_next_page,500);
                }
            });
        });
    </script>
    <?php 
    }
    ?>
    
    <!-- Dropplets Tools -->
    <?php 
    include './dropplets/tools.php';
    ?>
    
    <!-- User Footer Injection -->
    <?php 
    echo FOOTER_INJECT;
    ?>
    
    <!-- Plugin Footer Injection -->
    <?php 
    action::run('dp_footer');
}
 function form_action($name = '')
 {
     $this->validator =& new validator();
     parent::action($name);
 }
Example #15
0
<?php

include "../config/config.php";
include "../common/mysql.class.php";
include "action.php";
$db = new action($mydbhost, $mydbuser, $mydbpw, $mydbname, ALL_PS, $mydbcharset);
session_start();
$uid = $_SESSION['admin_uid'];
$shell = $_SESSION['admin_shell'];
$db->getUserShellCheck($uid, $shell);
$db->getUserOntime();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Panel</title>
<link href="css/manager.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="title">System Information</div>
<div align="center" class="main_body">
<div class="sysinfo">
<p>SERVER NAME:<?php 
echo $_SERVER['SERVER_NAME'];
?>
</p>
<ul>
<li>HTTP HOST:<?php 
echo $_SERVER['HTTP_HOST'];
?>
<?php

if (!defined('KIRBY')) {
    die('Direct access is not allowed');
}
if ($panel->action != 'edit-file') {
    return;
}
$action = action::editFile();
$file = data::fileByFilename();
$form = new fileform($settings, $file);
if (!$file) {
    go(showurl('files'));
}
?>
<div class="overlay edit-file">

  <form method="post">

    <?php 
growl($action);
?>

    <fieldset>
      <h3><?php 
echo l::get('files.edit.title');
?>
</h3>
      
      <div class="field">
        <label><?php 
Example #17
0
<?php

if (!defined('KIRBY')) {
    die('Direct access is not allowed');
}
snippet('header');
if (!$page->isHomePage() && !$page->isErrorPage()) {
    $action = action::updateURL();
    ?>
<div class="options form">

  <form action="<?php 
    echo thisURL();
    ?>
" method="post">
    
    <fieldset>    
      <div class="field url">
        <label><?php 
    echo l::get('options.url');
    ?>
</label>
        <span class="url input"><em><?php 
    echo dirname(ourl($page->url()));
    ?>
/</em><strong><input type="url" name="uid" value="<?php 
    echo $page->uid();
    ?>
" /></strong></span>
      </div>
    </fieldset>
Example #18
0
 */
$require_current_course = TRUE;
$require_help = TRUE;
$helpTopic = 'Agenda';
$guest_allowed = true;

require_once '../../include/baseTheme.php';
require_once 'include/action.php';
require_once 'include/log.php';
require_once 'include/lib/modalboxhelper.class.php';
require_once 'include/lib/multimediahelper.class.php';
require_once 'modules/search/agendaindexer.class.php';
require_once 'modules/agenda/course_calendar.inc.php';
ModalBoxHelper::loadModalBox();

$action = new action();
$action->record(MODULE_ID_AGENDA);
// define different views of agenda
define('EVENT_LIST_VIEW', 1);
define('EVENT_CALENDAR_VIEW', 0);

$dateNow = date("j-n-Y / H:i", time());

$toolName = $langAgenda;

if (isset($_GET['v'])) {
    $v = intval($_GET['v']); // get agenda view    
    if ($v == 1) {
        $view = EVENT_LIST_VIEW; // list view
    } else {
        $view = EVENT_CALENDAR_VIEW; // calendar view
Example #19
0
 function display($searchResult)
 {
     if ($searchResult) {
         echo "<div id='result' class='search'>";
         echo "<b>Suchergebnis - </b>";
         echo " <i class='normal'>" . count($searchResult) . " Treffer</i>";
         echo form::link("delete", "x", "index.php?action=hidesearch", "close-search");
         action::listit("search", $searchResult);
         foreach ($searchResult as $entry) {
             $nameArray = thesaurus::get_descriptor($entry[ID]);
             export::descriptor($nameArray[ID], session::get("search"), "SHOW");
             echo "<hr>";
         }
         // set parent
         if (session::get(show) != 0) {
             $parent = session::get(show);
         } else {
             $parent = system::getval("val_orderdefault");
         }
         // sugest new entry if orderdefault is set or OB is displayed
         if ($parent) {
             form::insert_entry(array('parent' => $parent, 'action' => 'add', ""), array(), session::get(search));
         } else {
             echo "<p>Kein Oberbegriff für neuen Begriff gesetzt.</p>";
         }
         echo "</div>";
     } else {
         echo "<div id='result' class='search'>";
         echo "<span class='red'>Kein Eintrag gefunden</span>";
         echo form::link("delete", "x", "index.php?action=hidesearch", "close-search");
         // set parent
         if (session::get(show) != 0) {
             $parent = session::get(show);
         } else {
             $parent = system::getval("val_orderdefault");
         }
         // sugest new entry if orderdefault is set or OB is displayed
         if ($parent) {
             form::insert_entry(array('parent' => $parent, 'action' => 'add', ""), array(), session::get(search));
         } else {
             echo "<p>Kein Oberbegriff für neuen Begriff gesetzt.</p>";
         }
         echo "</div>";
     }
 }
 function form_action()
 {
     $this->validator =& new validator();
     parent::action();
 }
 function recover_version_action()
 {
     parent::action();
 }
Example #22
0
define('HIDE_TOOL_TITLE', 1);
$require_current_course = true;
$guest_allowed = true;
$require_help = TRUE;
$helpTopic = 'AddCourseUnitscontent';

require_once '../../include/baseTheme.php';
require_once 'include/lib/fileDisplayLib.inc.php';
require_once 'include/action.php';
require_once 'functions.php';
require_once 'modules/document/doc_init.php';
require_once 'modules/tags/moduleElement.class.php';
require_once 'include/lib/modalboxhelper.class.php';
require_once 'include/lib/multimediahelper.class.php';

$action = new action();
$action->record(MODULE_ID_UNITS);

if (isset($_REQUEST['id'])) {
    $id = intval($_REQUEST['id']);
}
if (isset($_GET['cnt'])) {
    $cnt = intval($_REQUEST['cnt']);
}

$pageName = '';
$lang_editor = $language;
load_js('tools.js');
ModalBoxHelper::loadModalBox(true);

if (isset($_REQUEST['edit_submitW'])) { //update title and comments for week
    }
    function display()
    {
        if ($this->jump == true) {
            $say = '<p>
                <strong>The ball was delivered ' . $this->arm . ' handed by ' . $this->name . ' with great skill!</strong>
            </p>';
        } else {
            if ($this->jump == false) {
                $say = '<p>
                <strong>The ball was delivered ' . $this->arm . ' handed by ' . $this->name . ' with little skill!</strong>
            </p>';
            }
        }
        return $say . '
            <p>
                Skill One ' . $this->speed . ' / ' . $this->skill1 . '
            </p>
            <p>
                Skill Two ' . $this->jump . ' / ' . $this->skill2 . '
            </p>';
    }
}
#############################
#############################
##USAGE Example
#############################
#############################
$bowler = new action();
$bowler->set('Steven Finn', 'r', rand(0, 100), rand(0, 100));
echo $bowler->display();
Example #24
0
// locate course id
$course_id = null;
$res1 = Database::get()->querySingle("SELECT course.id FROM course WHERE course.code = ?s", q($_GET['course']));
if ($res1) {
    $course_id = intval($res1->id);
}

if ($course_id == null) {
    header("Location: ${urlServer}");
    exit();
}

if ($uid) {
    require_once 'include/action.php';
    $action = new action();
    $action->record(MODULE_ID_VIDEO);
}

// ----------------------
// download video
// ----------------------
$res2 = Database::get()->querySingle("SELECT * FROM video
                  WHERE course_id = ?d AND id = ?d", $course_id, $_GET['id']);

if (!$res2) {
    header("Location: ${urlServer}");
    exit();
}

$valid = ($uid || course_status($course_id) == COURSE_OPEN) ? true : token_validate($row2['path'], $_GET['token'], 30);
 function logout_action($name = '')
 {
     parent::action($name);
 }
	function display_template_source_action($name='')
	{
		parent :: action($name);
	}
Example #27
0
<?php

if (!defined('KIRBY')) {
    die('Direct access is not allowed');
}
?>

<?php 
snippet('header');
?>

<?php 
if (!$panel->nocontent) {
    action::updateContent();
    ?>

<div class="form">		
  
  <form action="<?php 
    echo showurl('content');
    ?>
" method="post">
    
    <?php 
    echo $panel->form->load();
    ?>
		

    <fieldset class="bottom">
      <div class="buttons">
        <input type="submit" name="update-content" value="<?php 
Example #28
0
require_once '../../include/baseTheme.php';
require_once 'include/lib/modalboxhelper.class.php';
require_once 'include/lib/multimediahelper.class.php';
require_once 'include/log.php';

ModalBoxHelper::loadModalBox();

$edit_url = $base_url = 'index.php?course=' . $course_code;
$cat_url = 'categories.php?course=' . $course_code;

/*
 * *** The following is added for statistics purposes **
 */
require_once 'include/action.php';
$action = new action();
$action->record(MODULE_ID_GLOSSARY);

if ($is_editor) {
    load_js('tools.js');
    $max_glossary_terms = get_config('max_glossary_terms');
}

$toolName = $langGlossary;

$categories = array();
Database::get()->queryFunc("SELECT id, name, description, `order`
                      FROM glossary_category WHERE course_id = ?d
                      ORDER BY name", function ($cat) use (&$categories) {
    $categories[intval($cat->id)] = $cat->name;
}, $course_id);
function get_includes($location)
{
    extract($GLOBALS);
    // Default includes for the footer.
    if ($location == 'footer') {
        ?>
    <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $(document).on('click', '#pagination a',function(e) {
                e.preventDefault();
                var page_url=$(this).prop('href');
                
                $('#gallery').append('<div id="loading" class="animated flash"></div>');
                $('#gallery').load(page_url + ' #gallery');
                $('html, body').animate({
                    scrollTop: $("#gallery").offset().top
                }, 400);
                
            });
        });
    </script>
    <?php 
    }
    // For addons.
    action::run($location);
}
 function tree_change_order_action($name = '')
 {
     parent::action($name);
 }