<?php if (Mreq::tg('_tsk') == 'errorjs' && Mreq::tg('noscript') == 0) { //exit(Mreq::tg('noscript').' 1'); header('location:./'); } else { //exit(Mreq::tg('noscript').' 2'); $session = new session(); if (!$session->stop()) { return false; } else { view::load('ajax', 'errorjs'); } }
<!-- styles --> <body class="login-layout"> <div class="main-container container-fluid"> <div class="main-content"> <div class="row-fluid"> <div class="span12"> <div class="login-container"> <div class="row-fluid"> <div class="center"> <!-- ==== load app here==== --> <?php $execute_app = new MAjax(); $execute_app->is_appli = true; $execute_app->default_app = Mreq::tg('_tsk') != "0" ? Mreq::tg('_tsk') : 'login'; $execute_app->load(); //applic::load(1,0); ?> </div><!--/position-relative--> </div> </div> </div><!--/.span--> </div><!--/.row-fluid--> </div> </div><!--/.main-container--> <!-- ======== --> </body> </html>
public static function auto_lastexec($field) { if (!isset($_SESSION[$field]) or Mreq::tg('tik') == 0) { $_SESSION[$field] = time(); } }
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8" /> <title><?php echo SYS_TITRE . ' | ' . MCfg::get('sys_desc') . ' | ' . CLIENT_TITRE; ?> .</title> <meta name="description" content="overview & stats" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <?php if (Mreq::tg('noscript') == "0" && Mreq::tg('_tsk') != 'errorjs') { $error_link = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?_tsk=errorjs&noscript=1'; ?> <noscript> <meta http-equiv="refresh" content="0;url=<?php echo $error_link; ?> "/> </noscript> <?php } ?> <?php require_once 'css.php'; ?> <!--inline styles related to this page--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
public static function load($ifsses, $appid) { //Format Messages $msg_ajax = '<div class="alert alert-error"><strong><i class="icon-remove"></i>Attention!</strong><br> Vous n\'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\AJAX</div>'; $msg_app = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\APP"; $msg_file = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\FILE"; $msg_perm = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\PERMISSION_USER"; $msg_sess = "Vous n'êtes pas autorisé(e) à accéder à cette application , redirection vers acceuil.... \\SESSION_USER"; //Avant tout on check le browser //exit($appid); if (!MInit::check_browser()) { $errpage = "Navigateur non supporté<br> merci de contacter le Service Informatique de <<CLIENT>>."; //header("location:ff.exe"); exit(msgbox($errpage, 0, '', 45)); } global $db; Cookie::close_session_open(); $default_applic_id = $ifsses == 1 ? 'login' : $appid; //exit(Mreq::tg('_tsk')); $app_id = Mreq::tg('_tsk') != "0" ? Mreq::tg('_tsk') : $default_applic_id; if (!$db->Query("SELECT * FROM task where app='{$app_id}' ")) { $db->Kill($db->Error()); } if ($db->RowCount() == 0) { exit("3#{$msg_app}'"); } $array = $db->RowArray(); $appc_idc = $array['id']; $needsession = $array['session']; $app_rep = $array['rep']; $app_file = $array['file']; $app_ajax = $array['ajax']; $app_target = MPATH_MODULES . $app_rep . SLASH . $app_file . '_c.php'; if ($app_ajax == 1) { exit("3#{$msg_ajax}"); } //Check if is good appli not need session $good_app = $db->QuerySingleValue0("select modul from task where id = {$appc_idc}"); if ($needsession == 1 && session::get('userid') == FALSE) { //exit("3#$msg_sess"); header('location:./'); } if ($needsession == 0 && session::get('userid') == TRUE) { //exit("3#$msg_sess"); header('location:./'); } if ($good_app == "0") { $sql = "SELECT * FROM permission_users where perm=1 and appid=" . $appc_idc . " and userid=" . $_SESSION['userid']; if (!$db->Query($sql)) { $db->Kill($db->Error()); } if ($db->RowCount() <= 0) { exit("3#{$msg_perm} "); } } if (!file_exists($app_target)) { print "3#{$msg_file} {$app_target}"; } else { define('ACTIV_APP', $array['dscrip']); define('MODUL_APP', $array['modul']); define('APP_ID', $array['id']); require_once $app_target; } }
<div class="clearfix"> </div> <div class="table-header"> Formulaire: "<?php echo ACTIV_APP; ?> " </div> <div class="widget-content"> <div class="widget-box"> <?php $form = new Mform('addtask', 'addtask', 'task'); $form->input_hidden('id_modul', Mreq::tg('id')); //Déscription application $desc_array[] = array('required', 'true', 'Insérer la Déscription'); $form->input('Déscription', 'description', 'text', 6, null, $desc_array); //Nom Application $app_array[] = array('required', 'true', 'Insérer Nom d l' . "\\'" . ' application'); $app_array[] = array('minlength', '3', 'Minimum 3 caractères'); $app_array[] = array('remote', 'app#task', 'Ce nom existe déja'); $form->input('Nom Application', 'app', 'text', 6, null, $app_array); //Option Application système $app_sys = array('NON' => 0, 'OUI' => 1); $form->select('Application Système', 'app_sys', 3, $app_sys, $indx = NULL, $selected = NULL); //Button submit $form->button('Enregistrer Application'); //Add JS function if need //$form->js_add_funct('alert(\'Test alert\');');