Example #1
0
 function profile($udata)
 {
     $sql = e107::getDb();
     if (!($total_forumposts = e107::getRegistry('total_forumposts'))) {
         $total_forumposts = intval($sql->count("forum_post"));
         e107::setRegistry('total_forumposts', $total_forumposts);
     }
     $count = $sql->retrieve('user_extended', 'user_plugin_forum_posts', 'user_extended_id = ' . $udata['user_id']);
     $perc = $total_forumposts > 0 && $count ? round($count / $total_forumposts * 100, 2) : 0;
     $url = $count > 0 ? e_HTTP . "userposts.php?0.forums." . $udata['user_id'] : null;
     $var = array(0 => array('label' => LAN_PLUGIN_FORUM_POSTS, 'text' => intval($count) . " ( " . $perc . "% )", 'url' => $url));
     return $var;
 }
Example #2
0
 function profile($udata)
 {
     $pref = e107::getPref();
     if (!$pref['cb_user_addon']) {
         return array();
     }
     if (!($chatposts = e107::getRegistry('total_chatposts'))) {
         $chatposts = 0;
         // In case plugin not installed
         if (e107::isInstalled("chatbox_menu")) {
             $chatposts = e107::getDb()->count("chatbox");
         }
         e107::setRegistry('total_chatposts', $chatposts);
     }
     $perc = $chatposts > 0 ? round($udata['user_chats'] / $chatposts * 100, 2) : 0;
     $var = array(0 => array('label' => LAN_PLUGIN_CHATBOX_MENU_POSTS, 'text' => $udata['user_chats'] . " ( " . $perc . "% )"));
     return $var;
 }
Example #3
0
 /**
  * Example usage: {NEWSITEM_SCHOOK=mysc_name|my_var1=val1&myvar2=myval2}
  * will fire {MYSC_NAME=news_id=1&my_var1=val1&myvar2=myval2}
  * Inside your 'MYSC_NAME' shortcode you are also able to access current item data this way
  * <code>
  * $newsdata = e107::getRegistry('core/news/schook_data');
  * //returns array('data' => (array) $current_news_data, 'params' => array() $current_params)
  * </code>
  *
  * @param string $parm
  * @return string
  */
 function sc_newsitem_schook($parm = '')
 {
     $parm = explode('|', $parm, 2);
     $parm[1] = 'news_id=' . $this->news_item['news_id'] . (varset($parm[1]) ? '&' . $parm[1] : '');
     e107::setRegistry('core/news/schook_data', array('data' => $this->news_item, 'params' => $this->param));
     return e107::getParser()->parseTemplate('{' . strtoupper($parm[0]) . '=' . $parm[1] . '}');
 }
Example #4
0
 /**
  * Constructor
  * @param e_admin_request $request
  * @param e_admin_response $response
  * @param array $params [optional]
  */
 public function __construct($request, $response, $params = array())
 {
     $this->setDefaultAction($request->getDefaultAction());
     $params['enable_triggers'] = true;
     // override
     parent::__construct($request, $response, $params);
     if (!$this->pluginName) {
         $this->pluginName = 'core';
     }
     $ufieldpref = $this->getUserPref();
     if ($ufieldpref) {
         $this->fieldpref = $ufieldpref;
     }
     $this->addTitle($this->pluginTitle, true)->parseAliases();
     $this->initAdminAddons();
     if ($help = $this->renderHelp()) {
         if (!empty($help)) {
             e107::setRegistry('core/e107/adminui/help', $help);
         }
     }
 }
Example #5
0
        $text .= $this->renderValue('options', $value, $att, $id);
        $text .= "</span>";
        return $text;
    }
}
new mailout_admin();
$e_sub_cat = 'mail';
$action = $tp->toDB(varset($_GET['mode'], 'makemail'));
$pageMode = varset($_GET['savepage'], $action);
// Sometimes we need to know what brought us here - $action gets changed
$mailId = intval(varset($_GET['m'], 0));
$targetId = intval(varset($_GET['t'], 0));
// Create mail admin object, load all mail handlers
$mailAdmin = new mailoutAdminClass($action);
// This decodes parts of the query using $_GET syntax
e107::setRegistry('_mailout_admin', $mailAdmin);
if ($mailAdmin->loadMailHandlers() == 0) {
    // No mail handlers loaded
    //	echo 'No mail handlers loaded!!';
    //exit;
}
require_once e_ADMIN . 'auth.php';
e107::getAdminUI()->runPage();
require_once e_ADMIN . 'footer.php';
$errors = array();
$subAction = '';
$midAction = '';
$fromHold = FALSE;
if (isset($_POST['mailaction'])) {
    if (is_array($_POST['mailaction'])) {
        foreach ($_POST['mailaction'] as $k => $v) {
Example #6
0
 /**
  * Generic List Form, used internal by admin UI
  * Expected options array format:
  * <code>
  * <?php
  * $form_options['myplugin'] = array(
  * 		'id' => 'myplugin', // unique string used for building element ids, REQUIRED
  * 		'pid' => 'primary_id', // primary field name, REQUIRED
  * 		'url' => '{e_PLUGIN}myplug/admin_config.php', // if not set, e_SELF is used
  * 		'query' => 'mode=main&amp;action=list', // or e_QUERY if not set
  * 		'head_query' => 'mode=main&amp;action=list', // without field, asc and from vars, REQUIRED
  * 		'np_query' => 'mode=main&amp;action=list', // without from var, REQUIRED for next/prev functionality
  * 		'legend' => 'Fieldset Legend', // hidden by default
  * 		'form_pre' => '', // markup to be added before opening form element (e.g. Filter form)
  * 		'form_post' => '', // markup to be added after closing form element
  * 		'fields' => array(...), // see e_admin_ui::$fields
  * 		'fieldpref' => array(...), // see e_admin_ui::$fieldpref
  * 		'table_pre' => '', // markup to be added before opening table element
  * 		'table_post' => '', // markup to be added after closing table element (e.g. Batch actions)
  * 		'fieldset_pre' => '', // markup to be added before opening fieldset element
  * 		'fieldset_post' => '', // markup to be added after closing fieldset element
  * 		'perPage' => 15, // if 0 - no next/prev navigation
  * 		'from' => 0, // current page, default 0
  * 		'field' => 'field_name', //current order field name, default - primary field
  * 		'asc' => 'desc', //current 'order by' rule, default 'asc'
  * );
  * $tree_models['myplugin'] = new e_admin_tree_model($data);
  * </code>
  * TODO - move fieldset & table generation in separate methods, needed for ajax calls
  * @param array $form_options
  * @param e_admin_tree_model $tree_model
  * @param boolean $nocontainer don't enclose form in div container
  * @return string
  */
 public function renderListForm($form_options, $tree_models, $nocontainer = false)
 {
     $tp = e107::getParser();
     $text = '';
     // print_a($form_options);
     foreach ($form_options as $fid => $options) {
         $tree_model = $tree_models[$fid];
         $tree = $tree_model->getTree();
         $total = $tree_model->getTotal();
         $amount = $options['perPage'];
         $from = vartrue($options['from'], 0);
         $field = vartrue($options['field'], $options['pid']);
         $asc = strtoupper(vartrue($options['asc'], 'asc'));
         $elid = $fid;
         //$options['id'];
         $query = vartrue($options['query'], e_QUERY);
         //  ? $options['query'] :  ;
         if (vartrue($_GET['action']) == 'list') {
             $query = e_QUERY;
             //XXX Quick fix for loss of pagination after 'delete'.
         }
         $url = isset($options['url']) ? $tp->replaceConstants($options['url'], 'abs') : e_SELF;
         $formurl = $url . ($query ? '?' . $query : '');
         $fields = $options['fields'];
         $current_fields = varset($options['fieldpref']) ? $options['fieldpref'] : array_keys($options['fields']);
         $legend_class = vartrue($options['legend_class'], 'e-hideme');
         $text .= "\r\n\t\t\t\t<form method='post' action='{$formurl}' id='{$elid}-list-form'>\r\n\t\t\t\t<div>" . $this->token() . "\r\n\t\t\t\t\t" . vartrue($options['fieldset_pre']) . "\r\n\t\t\t\t\t<fieldset id='{$elid}-list'>\r\n\t\t\t\t\t\t<legend class='{$legend_class}'>" . $options['legend'] . "</legend>\r\n\t\t\t\t\t\t" . vartrue($options['table_pre']) . "\r\n\t\t\t\t\t\t<table class='table adminlist table-striped' id='{$elid}-list-table'>\r\n\t\t\t\t\t\t\t" . $this->colGroup($fields, $current_fields) . "\r\n\t\t\t\t\t\t\t" . $this->thead($fields, $current_fields, varset($options['head_query']), varset($options['query'])) . "\r\n\t\t\t\t\t\t\t<tbody id='e-sort'>\r\n\t\t\t";
         if (!$tree) {
             $text .= "\r\n\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t</table>";
             $text .= "<div id='admin-ui-list-no-records-found' class=' alert alert-block alert-info center middle'>" . LAN_NO_RECORDS_FOUND . "</div>";
             // not prone to column-count issues.
         } else {
             foreach ($tree as $model) {
                 e107::setRegistry('core/adminUI/currentListModel', $model);
                 $text .= $this->renderTableRow($fields, $current_fields, $model->getData(), $options['pid']);
             }
             e107::setRegistry('core/adminUI/currentListModel', null);
             $text .= "</tbody>\r\n\t\t\t\t\t\t</table>";
         }
         $text .= vartrue($options['table_post']);
         if ($tree && $amount) {
             // New nextprev SC parameters
             $parms = 'total=' . $total;
             $parms .= '&amount=' . $amount;
             $parms .= '&current=' . $from;
             if (ADMIN_AREA) {
                 $parms .= '&tmpl_prefix=admin';
             }
             // NOTE - the whole url is double encoded - reason is to not break parms query string
             // 'np_query' should be proper (urlencode'd) url query string
             $url = rawurlencode($url . '?' . (varset($options['np_query']) ? str_replace(array('&amp;', '&'), array('&', '&amp;'), $options['np_query']) . '&amp;' : '') . 'from=[FROM]');
             $parms .= '&url=' . $url;
             //$parms = $total.",".$amount.",".$from.",".$url.'?'.($options['np_query'] ? $options['np_query'].'&amp;' : '').'from=[FROM]';
             //$text .= $tp->parseTemplate("{NEXTPREV={$parms}}");
             $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
             if ($nextprev) {
                 $text .= "<div class='nextprev-bar'>" . $nextprev . "</div>";
             }
         }
         $text .= "\r\n\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t" . vartrue($options['fieldset_post']) . "\r\n\t\t\t\t</div>\r\n\t\t\t\t</form>\r\n\t\t\t";
     }
     if (!$nocontainer) {
         $text = '<div class="e-container">' . $text . '</div>';
     }
     return vartrue($options['form_pre']) . $text . vartrue($options['form_post']);
 }
Example #7
0
 public function replaceRegistry()
 {
     e107::setRegistry('core/e107/session/' . $this->_namespace, $this, true);
 }
Example #8
0
/**
 * @deprecated use e107::setRegistry()
 * @param $id
 * @param $var
 */
function cachevars($id, $var)
{
    e107::setRegistry('core/cachedvars/' . $id, $var);
}
Example #9
0
     require_once HEADERF;
     renderCache($newsCachedPage, TRUE);
     // This exits if cache used
 }
 // <-- Cache
 if (isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) {
     $query = "\n\t  \tSELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_id, nc.category_name, nc.category_sef,\n\t\tnc.category_icon, nc.category_meta_keywords, nc.category_meta_description\n\t  \tFROM #news AS n\n\t\tLEFT JOIN #user AS u ON n.news_author = u.user_id\n\t\tLEFT JOIN #news_category AS nc ON n.news_category = nc.category_id\n\t\tLEFT JOIN #trackback AS tb ON tb.trackback_pid  = n.news_id\n\t\tWHERE n.news_id=" . intval($sub_action) . " AND n.news_class REGEXP '" . e_CLASS_REGEXP . "'\n\t\tAND NOT (n.news_class REGEXP " . $nobody_regexp . ")\n\t\tAND n.news_start < " . time() . " AND (n.news_end=0 || n.news_end>" . time() . ")\n\t\tGROUP by n.news_id";
 } else {
     $query = "\n\t  \tSELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords,\n\t\tnc.category_meta_description\n\t  \tFROM #news AS n\n\t\tLEFT JOIN #user AS u ON n.news_author = u.user_id\n\t\tLEFT JOIN #news_category AS nc ON n.news_category = nc.category_id\n\t\tWHERE n.news_class REGEXP '" . e_CLASS_REGEXP . "'\n\t\tAND NOT (n.news_class REGEXP " . $nobody_regexp . ")\n\t\tAND n.news_start < " . time() . "\n\t\tAND (n.news_end=0 || n.news_end>" . time() . ")\n\t\tAND n.news_id=" . intval($sub_action);
 }
 if ($sql->db_Select_gen($query)) {
     $news = $sql->db_Fetch();
     $id = $news['news_category'];
     // Use category of this news item to generate next/prev links
     //***NEW [SecretR] - comments handled inside now
     e107::setRegistry('news/page_allow_comments', !$news['news_allow_comments']);
     if (!$news['news_allow_comments'] && isset($_POST['commentsubmit'])) {
         $pid = intval(varset($_POST['pid'], 0));
         // ID of the specific comment being edited (nested comments - replies)
         $clean_authorname = $_POST['author_name'];
         $clean_comment = $_POST['comment'];
         $clean_subject = $_POST['subject'];
         e107::getSingleton('comment')->enter_comment($clean_authorname, $clean_comment, 'news', $sub_action, $pid, $clean_subject);
     }
     //More SEO
     setNewsFrontMeta($news);
     /*
     		if($news['news_title'])
     		{
     		if($pref['meta_news_summary'] && $news['news_title'])
     		{
Example #10
0
 function sc_user_jump_link($parm)
 {
     global $full_perms;
     $sql = e107::getDb();
     $tp = e107::getParser();
     if (!$full_perms) {
         return;
     }
     $url = e107::getUrl();
     if (!($userjump = e107::getRegistry('userjump'))) {
         //  $sql->db_Select("user", "user_id, user_name", "`user_id` > ".intval($this->var['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
         $sql->gen("SELECT user_id, user_name FROM `#user` FORCE INDEX (PRIMARY) WHERE `user_id` > " . intval($this->var['user_id']) . " AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
         if ($row = $sql->fetch()) {
             $userjump['next']['id'] = $row['user_id'];
             $userjump['next']['name'] = $row['user_name'];
         }
         //  $sql->db_Select("user", "user_id, user_name", "`user_id` < ".intval($this->var['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
         $sql->gen("SELECT user_id, user_name FROM `#user` FORCE INDEX (PRIMARY) WHERE `user_id` < " . intval($this->var['user_id']) . " AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
         if ($row = $sql->fetch()) {
             $userjump['prev']['id'] = $row['user_id'];
             $userjump['prev']['name'] = $row['user_name'];
         }
         e107::setRegistry('userjump', $userjump);
     }
     if ($parm == 'prev') {
         $icon = deftrue('BOOTSTRAP') ? $tp->toGlyph('chevron-left') : '&lt;&lt;';
         return isset($userjump['prev']['id']) ? "<a class='e-tip' href='" . $url->create('user/profile/view', $userjump['prev']) . "' title=\"" . $userjump['prev']['name'] . "\">" . $icon . " " . LAN_USER_40 . "</a>\n" : "&nbsp;";
         // return isset($userjump['prev']['id']) ? "&lt;&lt; ".LAN_USER_40." [ <a href='".$url->create('user/profile/view', $userjump['prev'])."'>".$userjump['prev']['name']."</a> ]" : "&nbsp;";
     } else {
         $icon = deftrue('BOOTSTRAP') ? $tp->toGlyph('chevron-right') : '&gt;&gt;';
         return isset($userjump['next']['id']) ? "<a class='e-tip' href='" . $url->create('user/profile/view', $userjump['next']) . "' title=\"" . $userjump['next']['name'] . "\">" . LAN_USER_41 . " " . $icon . "</a>\n" : "&nbsp;";
         // return isset($userjump['next']['id']) ? "[ <a href='".$url->create('user/profile/view', $userjump['next'])."'>".$userjump['next']['name']."</a> ] ".LAN_USER_41." &gt;&gt;" : "&nbsp;";
     }
 }
Example #11
0
 /**
  * Simplify importing of theme Language files (following e107 plugin structure standards).
  * All inputs are sanitized.
  *
  * Examples:
  * <code><?php
  * 	// import defeinitions from /e107_themes/[CurrentTheme]/languages/[CurrentLanguage]/lan.php
  * 	e107::themeLan('lan');
  *
  * 	// import defeinitions from /e107_themes/[currentTheme]/languages/[CurrentLanguage].php
  * 	e107::themeLan();
  *
  * 	// import defeinitions from /e107_themes/[currentTheme]/languages/[CurrentLanguage]_lan.php
  * 	e107::themeLan('lan', null, true);
  *
  * 	// import defeinitions from /e107_themes/[currentTheme]/languages/[CurrentLanguage]/admin/lan.php
  * 	e107::themeLan('admin/lan');
  * 
  * 	// import defeinitions from /e107_themes/some_theme/languages/[CurrentLanguage].php
  * 	e107::themeLan('', 'some_theme');
  * </code>
  *
  * @param string $fname filename without the extension part (e.g. 'common' for common.php)
  * @param string $theme theme name, if null current theme will be used
  * @param boolean $flat false (default, preferred) Language folder structure; true - prepend Language to file name
  * @return void
  */
 public static function themeLan($fname = '', $theme = null, $flat = false)
 {
     if (null === $theme) {
         $theme = THEME . '/languages/';
     } else {
         $theme = e_THEME . preg_replace('#[^\\w/]#', '', $theme) . '/languages/';
     }
     $cstring = 'themelan/' . $theme . $fname . ($flat ? '_1' : '_0');
     if (e107::getRegistry($cstring)) {
         return;
     }
     if ($fname) {
         $fname = e_LANGUAGE . ($flat ? '_' : '/') . preg_replace('#[^\\w/]#', '', trim($fname, '/'));
     } else {
         $fname = e_LANGUAGE;
     }
     $path = $theme . $fname . '.php';
     if (E107_DBG_INCLUDES) {
         e107::getMessage()->addDebug("Attempting to Load: " . $path);
     }
     e107::setRegistry($cstring, true);
     self::includeLan($path, false);
 }
Example #12
0
 public function setListModel($model)
 {
     e107::setRegistry('core/adminUI/currentListModel', $model);
     return $this;
 }
Example #13
0
 /**
  * Simplify importing of theme Language files (following e107 plugin structure standards).
  * All inputs are sanitized.
  *
  * Examples:
  * <code><?php
  * 	// import defeinitions from /e107_themes/[CurrentTheme]/languages/[CurrentLanguage]/lan.php
  * 	e107::themeLan('lan');
  *
  * 	// import defeinitions from /e107_themes/[currentTheme]/languages/[CurrentLanguage].php
  * 	e107::themeLan();
  *
  * 	// import defeinitions from /e107_themes/[currentTheme]/languages/[CurrentLanguage]_lan.php
  * 	e107::themeLan('lan', null, true);
  *
  * 	// import defeinitions from /e107_themes/[currentTheme]/languages/[CurrentLanguage]/admin/lan.php
  * 	e107::themeLan('admin/lan');
  * 
  * 	// import defeinitions from /e107_themes/some_theme/languages/[CurrentLanguage].php
  * 	e107::themeLan('', 'some_theme');
  * </code>
  *
  * @param string $fname filename without the extension part (e.g. 'common' for common.php)
  * @param string $theme theme name, if null current theme will be used
  * @param boolean $flat false (default, preferred) Language folder structure; true - prepend Language to file name
  * @return void
  */
 public static function themeLan($fname = '', $theme = null, $flat = false)
 {
     if (null === $theme) {
         $theme = THEME . '/languages/';
     } else {
         $theme = e_THEME . preg_replace('#[^\\w/]#', '', $theme) . '/languages/';
     }
     $cstring = 'themelan/' . $theme . $fname . ($flat ? '_1' : '_0');
     if (e107::getRegistry($cstring)) {
         return;
     }
     if ($fname) {
         $fname = e_LANGUAGE . ($flat ? '_' : '/') . preg_replace('#[^\\w/]#', '', $fname);
     } else {
         $fname = e_LANGUAGE;
     }
     $path = $theme . $fname . '.php';
     e107::setRegistry($cstring, true);
     self::includeLan($path, false);
 }
Example #14
0
 function triggerAdminEvent($type, $parms = array())
 {
     global $pref;
     if (!is_array($parms)) {
         $_tmp = parse_str($parms, $parms);
     }
     if (isset($pref['e_admin_events_list']) && is_array($pref['e_admin_events_list'])) {
         // $called = getcachedvars('admin_events_called');
         $called = e107::getRegistry('core/cachedvars/admin_events_called', false);
         if (!is_array($called)) {
             $called = array();
         }
         foreach ($pref['e_admin_events_list'] as $plugin) {
             if (e107::isInstalled($plugin)) {
                 $func = 'plugin_' . $plugin . '_admin_events';
                 if (!function_exists($func)) {
                     $fname = e_PLUGIN . $plugin . '/e_admin_events.php';
                     if (is_readable($fname)) {
                         include_once $fname;
                     }
                 }
                 if (function_exists($func)) {
                     $event_func = call_user_func($func, $type, $parms);
                     if ($event_func && function_exists($event_func) && !in_array($event_func, $called)) {
                         $called[] = $event_func;
                         // cachevars('admin_events_called', $called);
                         e107::setRegistry('core/cachedvars/admin_events_called', $called);
                         call_user_func($event_func);
                     }
                 }
             }
         }
     }
 }
Example #15
0
 *
 * $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu.php,v $
 * $Revision$
 * $Date$
 * $Author$
*/
if (!defined('e107_INIT')) {
    exit;
}
require_once e_PLUGIN . "comment_menu/comment_menu_shortcodes.php";
$cobj = e107::getObject('comment');
//require_once (e_HANDLER."comment_class.php");
//$cobj = new comment;
if (file_exists(THEME . "comment_menu_template.php")) {
    require_once THEME . "comment_menu_template.php";
} else {
    require_once e_PLUGIN . "comment_menu/comment_menu_template.php";
}
$data = $cobj->getCommentData(intval($menu_pref['comment_display']));
$text = '';
// no posts yet ..
if (empty($data) || !is_array($data)) {
    $text = CM_L1;
}
foreach ($data as $row) {
    e107::setRegistry('plugin/comment_menu/current', $row);
    $text .= $tp->parseTemplate($COMMENT_MENU_TEMPLATE, true, $comment_menu_shortcodes);
}
e107::setRegistry('plugin/comment_menu/current', null);
$title = e107::getConfig('menu')->get('comment_caption');
e107::getRender()->tablerender(defset($title, $title), $text, 'comment_menu');
Example #16
0
        header('location:' . e_SELF);
        exit;
    }
    return true;
}
if (e_QUERY) {
    // BC - SO MUCH BAD, never do this at home!!!
    if (isset($_GET['action'])) {
        $uc_qs = array($_GET['action'], $_GET['id']);
    } else {
        $uc_qs = explode('.', e_QUERY);
    }
}
$action = varset($uc_qs[0]);
$params = varset($uc_qs[1], '');
e107::setRegistry('pageParams', $uc_qs);
//AJAX request check is already  made by the API
/*
if(e_AJAX_REQUEST)
{
    $class_num = intval($params);
	if ($action == 'edit')
	{
	    require_once(e_HANDLER.'js_helper.php');
	    $jshelper = new e_jshelper();
	    if(!checkAllowed($class_num, false))
		{
			//This will raise an error
			//'Access denied' is the message which will be thrown
			//by the JS AJAX handler
			e_jshelper::sendAjaxError('403', 'Access denied. '.UCSLAN_90);
Example #17
0
 /**
  * Destroy cookie/session data, self destroy
  * @return e_user
  */
 public final function logout()
 {
     if ($this->hasProvider()) {
         $this->getProvider()->logout();
     }
     $this->logoutAs()->_destroySession();
     parent::destroy();
     //if(session_id()) session_destroy();
     e107::getSession()->destroy();
     e107::setRegistry('core/e107/current_user', null);
     return $this;
 }
Example #18
0
File: page.php Project: armpit/e107
 public function setRequest($request)
 {
     switch ($request) {
         case 'listChapters':
             $id = intval($_GET['bk']);
             break;
         case 'listPages':
             $id = intval($_GET['ch']);
             break;
         case 'showPage':
             $id = $this->pageID;
             break;
         case 'listBooks':
         default:
             $id = 0;
             break;
     }
     e107::setRegistry('core/pages/request', array('action' => $request, 'id' => $id));
 }
Example #19
0
 *
 * News Administration
 *
 * $URL $
 * $Id$
*/
require_once '../class2.php';
if (!getperms('H|N')) {
    header('Location:' . e_BASE . 'index.php');
    exit;
}
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE);
// ------------------------------
// done in class2: require_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); // maybe this should be put in class2.php when 'admin' is detected.
$newspost = new admin_newspost(e_QUERY, $pst);
e107::setRegistry('_newspost_admin', $newspost);
$gen = new convert();
//Handle Ajax Calls
if ($newspost->ajax_observer()) {
    exit;
}
e107::js('core', 'core/admin.js', 'prototype');
//e107::getJs()->requireCoreLib('core/admin.js');
class news_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'news_admin_ui', 'path' => null, 'ui' => 'news_form_ui', 'uipath' => null), 'cat' => array('controller' => 'news_cat_ui', 'path' => null, 'ui' => 'news_cat_form_ui', 'uipath' => null), 'sub' => array('controller' => 'news_sub_ui', 'path' => null, 'ui' => 'news_sub_form_ui', 'uipath' => null));
    protected $adminMenu = array('main/list' => array('caption' => NWSLAN_44, 'perm' => 'H'), 'main/create' => array('caption' => NWSLAN_45, 'perm' => 'H'), 'cat/list' => array('caption' => NWSLAN_46, 'perm' => '7'), 'cat/create' => array('caption' => "Create Category", 'perm' => '7'), 'main/settings' => array('caption' => LAN_PREFS, 'perm' => '0'), 'sub/list' => array('caption' => NWSLAN_47, 'perm' => 'N'));
    protected $adminMenuAliases = array('main/edit' => 'main/list', 'cat/edit' => 'cat/list');
    protected $menuTitle = "News";
}
class news_cat_ui extends e_admin_ui