Ejemplo n.º 1
0
 function __construct()
 {
     $pref = e107::pref('core');
     if (getperms('0')) {
         $this->testMode = true;
     }
     if (substr(e_QUERY, 0, 9) == 'activate.') {
         $this->processActivationLink();
     }
     if (e_QUERY == 'resend' && (!USER || $this->testMode) && $pref['user_reg_veri'] == 1) {
         if (empty($_POST['submit_resend'])) {
             $this->renderResendForm();
         } else {
             $this->resendEmail();
         }
     }
     if ($this->testMode == true) {
         if (e_QUERY == 'preview') {
             $this->renderEmailPreview();
         }
         if (e_QUERY == "preview.aftersignup") {
             $this->renderAfterSignupPreview();
         }
         if (e_QUERY == 'test') {
             $this->sendEmailPreview();
         }
     }
 }
Ejemplo n.º 2
0
    /**
     *
     */
    function __construct()
    {
        $html = '';
        if (!empty($_GET['debug']) && getperms('0')) {
            $debug = true;
            // For future use.
            $text = <<<TEMPL

\t[html][code]Something goes here [b]bold print[/b][/code][/html]

TEMPL;
            $_POST['content'] = $text;
            $_POST['mode'] = 'tohtml';
        } else {
            $debug = false;
        }
        if ($_POST['mode'] == 'tohtml') {
            $html = $this->toHtml($_POST['content']);
        }
        if ($_POST['mode'] == 'tobbcode') {
            $html = $this->toBBcode($_POST['content']);
        }
        if ($debug == true) {
            print_a($html);
            echo "<hr />";
            echo $html;
        } elseif ($this->gzipCompression == true) {
            header('Content-Encoding: gzip');
            $gzipoutput = gzencode($html, 6);
            header('Content-Length: ' . strlen($gzipoutput));
            echo $gzipoutput;
        } else {
            echo $html;
        }
    }
Ejemplo n.º 3
0
function check_allowed($class_id)
{
    global $sql;
    if (!$sql->db_Select('userclass_classes', '*', "userclass_id = {$class_id}")) {
        header("location:" . SITEURL);
        exit;
    }
    $row = $sql->db_Fetch();
    if (!getperms('0') && !check_class($row['userclass_editclass'])) {
        header("location:" . SITEURL);
        exit;
    }
}
Ejemplo n.º 4
0
 function sc_loginname($parm)
 {
     $pref = e107::getPref();
     if ($pref['allowEmailLogin'] == 1) {
         return;
         // hide login name when email-login is being used. (may contain social login info)
     }
     if (ADMIN && getperms("4")) {
         $log_name_length = varset($pref['loginname_maxlength'], 30);
         $options = array('title' => $pref['allowEmailLogin'] == 1 ? LAN_USER_82 : LAN_USER_80, 'size' => 40);
         return e107::getForm()->text('loginname', $this->var['user_loginname'], $log_name_length, $options);
     } else {
         return $this->var['user_loginname'];
     }
 }
Ejemplo n.º 5
0
Archivo: xup.php Proyecto: armpit/e107
 public function actionTest()
 {
     echo '<h3>Social Login Tester</h3>';
     if (getperms('0')) {
         echo e107::getMessage()->addError("Please logout of e107 before testing the new-user login/signup procedure.")->render();
         return;
     }
     if (isset($_GET['lgt'])) {
         e107::getUser()->logout();
     }
     $profileData = null;
     $provider = e107::getUser()->getProvider();
     if ($provider) {
         $profileData = $provider->getUserProfile();
         if (!empty($profileData)) {
             print_a($profileData);
         }
     }
     echo 'Logged in: ' . (e107::getUser()->isUser() && !empty($profileData) ? '<span class="label label-success">true</span>' : '<span class="label label-danger">false</span>');
     $testUrl = SITEURL . "?route=system/xup/test";
     $providers = e107::getPref('social_login', array());
     foreach ($providers as $key => $var) {
         if ($var['enabled'] == 1) {
             echo '<h3>' . $key . '</h3><ul>';
             echo '<li><a class="btn btn-default" href="' . e107::getUrl()->create('system/xup/login?provider=' . $key . '&back=' . base64_encode($testUrl)) . '">Test login only with ' . $key . '</a></li>';
             echo '<li><a class="btn btn-default" href="' . e107::getUrl()->create('system/xup/signup?provider=' . $key . '&back=' . base64_encode($testUrl)) . '">Test signup/login with ' . $key . '</a></li>';
             echo "</ul>";
         }
         //	print_a($var);
     }
     echo '<br /><br /><a class="btn btn-default" href="' . e107::getUrl()->create('system/xup/test?lgt') . '">Test logout</a>';
     /*
     		echo '<h3>Facebook</h3>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/login?provider=Facebook').'">Test login with Facebook</a>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Facebook').'">Test signup with Facebook</a>';
     		
     		echo '<h3>Twitter</h3>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/login?provider=Twitter').'">Test login with Twitter</a>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Twitter').'">Test signup with Twitter</a>';
     */
 }
Ejemplo n.º 6
0
/**
 * @todo user_class::isEditableClass() thinks public (0) is editable?!
 * @param integer $class_id
 * @param boolean $redirect
 * @return boolean
 */
function check_allowed($class_id, $redirect = true)
{
    $uc = e107::getUserClass();
    if (!isset($uc->class_tree[$class_id]) || !getperms('0') && !check_class($uc->class_tree[$class_id]['userclass_editclass'])) {
        if (!$redirect) {
            return false;
        }
        header('location:' . SITEURL);
        exit;
    }
    // fix public (0) case here for now
    if (!$class_id || !$uc->isEditableClass($class_id)) {
        if (!$redirect) {
            return false;
        }
        e107::getMessage()->addSession('You can\'t edit system user classes!', E_MESSAGE_ERROR);
        header('location:' . e_SELF);
        exit;
    }
    return true;
}
Ejemplo n.º 7
0
/*
 * e107 website system
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/phpinfo.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
require_once "../class2.php";
if (!getperms("0")) {
    e107::redirect('admin');
    exit;
}
$e_sub_cat = 'phpinfo';
require_once "auth.php";
ob_start();
phpinfo();
$phpinfo .= ob_get_contents();
$phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
$phpinfo = str_replace("font", "span", $phpinfo);
$phpinfo = str_replace("</body></html>", "", $phpinfo);
$phpinfo = str_replace('border="0"', '', $phpinfo);
//$phpinfo = str_replace('<table ','<table class="table table-striped adminlist" ',$phpinfo);
$phpinfo = str_replace('name=', 'id=', $phpinfo);
$phpinfo = str_replace('class="e"', 'class="forumheader2 text-left"', $phpinfo);
Ejemplo n.º 8
0
<?php

/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
*/
require_once '../../class2.php';
if (!getperms('1')) {
    header('location:' . e_BASE . 'index.php');
    exit;
}
require_once e_HANDLER . 'userclass_class.php';
include_lan(e_PLUGIN . 'newforumposts_main/languages/' . e_LANGUAGE . '.php');
require_once e_ADMIN . 'auth.php';
$frm = e107::getForm();
$mes = e107::getMessage();
if (isset($_POST['updatesettings'])) {
    $pref['nfp_display'] = intval($_POST['nfp_display']);
    $pref['nfp_caption'] = $tp->toDB($_POST['nfp_caption']);
    $pref['nfp_amount'] = intval($_POST['nfp_amount']);
    $pref['nfp_layer'] = intval(vartrue($_POST['nfp_layer']));
    $pref['nfp_posts'] = intval(vartrue($_POST['nfp_posts']));
    $pref['nfp_layer_height'] = intval($_POST['nfp_layer_height'] ? $_POST['nfp_layer_height'] : 200);
    save_prefs();
}
$ns->tablerender($caption, $mes->render() . $text);
$text = "\n\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='menu_conf_form'>\n\t<table class='table adminform'>\t \n\t<colgroup span='2'>\n\t\t<col class='col-label' />\n\t\t<col class='col-control' />\n\t</colgroup>\n\t<tr>\n\t\t<td>" . NFPM_L4 . "</td>\n\t\t<td>" . $frm->select('nfp_display', array(0 => NFPM_L5, 1 => NFPM_L6, 2 => NFPM_L7), $pref['nfp_display']) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . NFPM_L8 . ":</td>\n\t\t<td>" . $frm->text('nfp_caption', $pref['nfp_caption'], '100', array('class' => 'tbox input-text span3')) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . NFPM_L9 . ": </td>\n\t\t<td>" . $frm->text('nfp_amount', $pref['nfp_amount'], '3') . "</td>\n\t</tr>\t \n\t<tr>\n\t\t<td>" . NFPM_L14 . "</td>\n\t\t<td>" . $frm->radio_switch('nfp_posts', $pref['nfp_posts'], LAN_YES, LAN_NO) . "<span class='field-help'>" . NFPM_L15 . "</span></td>\n\t</tr>\t \n\t<tr>\n\t\t<td>" . NFPM_L10 . "</td>\n\t\t<td>" . $frm->radio_switch('nfp_layer', $pref['nfp_layer'], LAN_YES, LAN_NO) . "<br />\n\t\t" . NFPM_L11 . ": " . $frm->text('nfp_layer_height', $pref['nfp_layer_height'], '3') . "</td>\n\t</tr>\n\t</table>\n\t<div class='buttons-bar center'>\n\t\t" . $frm->admin_button('updatesettings', LAN_UPDATE, 'update') . "\n\t</div>\n\t</form>";
Ejemplo n.º 9
0
 function createemPage()
 {
     if (!getperms("J")) {
         return;
     }
     $this->createPage('menu');
 }
Ejemplo n.º 10
0
 * Copyright (C) 2008-2015 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * Administration Area - User classes
 *
*/
/**
 *	e107 Userclass handling - Admin
 *
 *	@package	e107
 *	@subpackage	admin
 *	@version 	$Id$;
 */
require_once '../class2.php';
if (!getperms('4')) {
    e107::redirect('admin');
    exit;
}
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE);
class uclass_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'uclass_ui', 'path' => null, 'ui' => 'uclass_ui_form', 'uipath' => null));
    protected $adminMenu = array('main/list' => array('caption' => LAN_MANAGE, 'perm' => '4'), 'main/create' => array('caption' => LAN_CREATE, 'perm' => '4'), 'main/initial' => array('caption' => UCSLAN_38, 'perm' => '4'), 'main/options' => array('caption' => LAN_OPTIONS, 'perm' => '4'));
    protected $adminMenuAliases = array('main/edit' => 'main/list');
    protected $menuTitle = ADLAN_38;
}
class uclass_ui extends e_admin_ui
{
    protected $pluginTitle = ADLAN_38;
    protected $pluginName = 'core';
Ejemplo n.º 11
0
 function render_infopanel_menu_options()
 {
     if (!getperms('0')) {
         return;
     }
     $frm = e107::getForm();
     $pref = e107::getPref();
     $text = "<div style='padding-left:20px'>";
     $menu_qry = 'SELECT * FROM #menus WHERE menu_id!= 0  GROUP BY menu_name ORDER BY menu_name';
     $settings = varset($pref['core-infopanel-menus'], array());
     if (e107::getDb()->db_Select_gen($menu_qry)) {
         while ($row = e107::getDb()->db_Fetch()) {
             $label = str_replace("_menu", "", $row['menu_name']);
             $path_to_menu = $row['menu_path'] . $row['menu_name'];
             $checked = $settings && in_array($path_to_menu, $settings) ? true : false;
             $text .= "\n<div class='left f-left list field-spacer' style='display:block;height:24px;width:200px;'>";
             $text .= $frm->checkbox_label($label, "e-mymenus[]", $path_to_menu, $checked);
             $text .= "</div>";
         }
     }
     $text .= "</div><div class='clear'>&nbsp;</div>";
     return $text;
 }
Ejemplo n.º 12
0
Archivo: admin.php Proyecto: gitye/e107
function admin_info()
{
    global $tp;
    $width = getperms('0') ? "33%" : "50%";
    $ADMIN_INFO_TEMPLATE = "\n\t<div style='text-align:center'>\n\t\t<table style='width: 100%; border-collapse:collapse; border-spacing:0px;'>\n\t\t<tr>\n\t\t\t<td style='width: " . $width . "; vertical-align: top'>\n\t\t\t{ADMIN_STATUS}\n\t\t\t</td>\n\t\t\t<td style='width:" . $width . "; vertical-align: top'>\n\t\t\t{ADMIN_LATEST}\n\t\t\t</td>";
    if (getperms('0')) {
        $ADMIN_INFO_TEMPLATE .= "\n\t\t\t<td style='width:" . $width . "; vertical-align: top'>{ADMIN_LOG}</td>";
    }
    $ADMIN_INFO_TEMPLATE .= "\n\t\t</tr></table></div>";
    return $tp->parseTemplate($ADMIN_INFO_TEMPLATE);
}
Ejemplo n.º 13
0
 function saveMailPrefs(&$mes)
 {
     if (!getperms('0')) {
         return;
     }
     //$pref = e107::getPref();
     $e107 = e107::getInstance();
     $tp = e107::getParser();
     $mes = e107::getMessage();
     $bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
     unset($temp);
     if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) {
         $_POST['mailer'] = 'php';
     }
     $temp['mailer'] = $_POST['mailer'];
     // Allow qmail as an option as well - works much as sendmail
     if (strpos($_POST['sendmail'], 'sendmail') !== FALSE || strpos($_POST['sendmail'], 'qmail') !== FALSE) {
         $temp['sendmail'] = $tp->toDB($_POST['sendmail']);
     } else {
         $temp['sendmail'] = '';
     }
     $temp['smtp_server'] = $tp->toDB($_POST['smtp_server']);
     $temp['smtp_username'] = $tp->toDB($_POST['smtp_username']);
     $temp['smtp_password'] = $tp->toDB($_POST['smtp_password']);
     $smtp_opts = array();
     switch (trim($_POST['smtp_options'])) {
         case 'smtp_ssl':
             $smtp_opts[] = 'secure=SSL';
             break;
         case 'smtp_tls':
             $smtp_opts[] = 'secure=TLS';
             break;
         case 'smtp_pop3auth':
             $smtp_opts[] = 'pop3auth';
             break;
     }
     if (vartrue($_POST['smtp_keepalive'])) {
         $smtp_opts[] = 'keepalive';
     }
     if (vartrue($_POST['smtp_useVERP'])) {
         $smtp_opts[] = 'useVERP';
     }
     $temp['smtp_options'] = implode(',', $smtp_opts);
     $temp['mail_sendstyle'] = $tp->toDB($_POST['mail_sendstyle']);
     $temp['mail_pause'] = intval($_POST['mail_pause']);
     $temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
     $temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
     $temp['mail_workpertick'] = min($temp['mail_workpertick'], 1000);
     $temp['mail_bounce'] = isset($bounceOpts[$_POST['mail_bounce']]) ? $_POST['mail_bounce'] : 'none';
     $temp['mail_bounce_auto'] = 0;
     // Make sure this is always defined
     switch ($temp['mail_bounce']) {
         case 'none':
             $temp['mail_bounce_email'] = '';
             break;
         case 'auto':
             $temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email2']);
             break;
         case 'mail':
             $temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email']);
             $temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
             break;
     }
     $temp['mail_bounce_pop3'] = $tp->toDB($_POST['mail_bounce_pop3']);
     $temp['mail_bounce_user'] = $tp->toDB($_POST['mail_bounce_user']);
     $temp['mail_bounce_pass'] = $tp->toDB($_POST['mail_bounce_pass']);
     $temp['mail_bounce_type'] = $tp->toDB($_POST['mail_bounce_type']);
     $temp['mail_bounce_delete'] = intval(varset($_POST['mail_bounce_delete'], 0));
     $temp['mailout_enabled'] = implode(',', varset($_POST['mail_mailer_enabled'], ''));
     $temp['mail_log_options'] = intval($_POST['mail_log_option']) . ',' . intval($_POST['mail_log_email']);
     foreach ($temp as &$t) {
         if ($t === NULL) {
             $t = '';
         }
     }
     $pref = e107::pref('core');
     // Core Prefs Array.
     if (e107::getAdminLog()->logArrayDiffs($temp, $pref, 'MAIL_03')) {
         e107::getConfig()->updatePref($temp);
         e107::getConfig()->save(false);
         // Only save if changes - generates its own message
     } else {
         $mes->addInfo(LAN_NO_CHANGE);
     }
 }
Ejemplo n.º 14
0
 * e107 website system
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $
 * $Revision: 12639 $
 * $Date: 2012-04-20 00:28:53 -0700 (Fri, 20 Apr 2012) $
 * $Author: e107coders $
 */
$eplug_admin = true;
require_once "../../class2.php";
if (!getperms("P") || !e107::isInstalled('gallery')) {
    header("location:" . e_BASE . "index.php");
    exit;
}
$e_sub_cat = 'gallery';
class plugin_gallery_admin extends e_admin_dispatcher
{
    /**
     * Format: 'MODE' => array('controller' =>'CONTROLLER_CLASS'[, 'index' => 'list', 'path' => 'CONTROLLER SCRIPT PATH', 'ui' => 'UI CLASS NAME child of e_admin_ui', 'uipath' => 'UI SCRIPT PATH']);
     * Note - default mode/action is autodetected in this order:
     * - $defaultMode/$defaultAction (owned by dispatcher - see below)
     * - $adminMenu (first key if admin menu array is not empty)
     * - $modes (first key == mode, corresponding 'index' key == action)
     * @var array
     */
    protected $modes = array('main' => array('controller' => 'gallery_cat_admin_ui', 'path' => null, 'ui' => 'gallery_cat_admin_form_ui', 'uipath' => null), 'cat' => array('controller' => 'gallery_cat_ui', 'path' => null, 'ui' => 'gallery_cat_form_ui', 'uipath' => null));
Ejemplo n.º 15
0
<?php

/*
 * e107 website system
 *
 * Copyright (C) e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * URL and front controller Management
 *
 * $URL$
 * $Id$
*/
require_once '../class2.php';
if (!ADMIN || !getperms('L')) {
    e107::redirect('admin');
    exit;
}
e107::coreLan('eurl', true);
// TODO - admin interface support, remove it from globals
$e_sub_cat = 'eurl';
e107::css('inline', " span.e-help { cursor: help } ");
class eurl_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'eurl_admin_ui', 'path' => null, 'ui' => 'eurl_admin_form_ui', 'uipath' => null));
    protected $adminMenu = array('main/config' => array('caption' => LAN_EURL_MENU_CONFIG, 'perm' => 'L'), 'main/alias' => array('caption' => LAN_EURL_MENU_ALIASES, 'perm' => 'L'), 'main/settings' => array('caption' => LAN_EURL_MENU_SETTINGS, 'perm' => 'L'), 'main/simple' => array('caption' => LAN_EURL_MENU_REDIRECTS, 'perm' => 'L'));
    protected $adminMenuAliases = array();
    protected $defaultAction = 'config';
    protected $menuTitle = LAN_EURL_MENU;
}
Ejemplo n.º 16
0
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/help/menus.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
if (!defined('e107_INIT')) {
    die("Unauthorised Access");
}
if (!getperms("2")) {
    header("location:" . e_BASE . "index.php");
    exit;
}
$sql = e107::getDb();
$tp = e107::getParser();
if (isset($_POST['reset'])) {
    for ($mc = 1; $mc <= 5; $mc++) {
        $sql->db_Select("menus", "*", "menu_location='" . $mc . "' ORDER BY menu_order");
        $count = 1;
        $sql2 = new db();
        while (list($menu_id, $menu_name, $menu_location, $menu_order) = $sql->db_Fetch()) {
            $sql2->db_Update("menus", "menu_order='{$count}' WHERE menu_id='{$menu_id}' ");
            $count++;
        }
        $text = "<b>Menus reset in database</b><br /><br />";
Ejemplo n.º 17
0
function language_adminmenu()
{
    $pref = e107::getPref();
    $action = e_QUERY;
    if ($action == "") {
        $action = getperms('0') ? "main" : "tools";
    }
    if ($action == "modify") {
        $action = "db";
    }
    if (getperms('0')) {
        $var['main']['text'] = LAN_PREFS;
        $var['main']['link'] = e_SELF;
        if (isset($pref['multilanguage']) && $pref['multilanguage']) {
            $var['db']['text'] = LANG_LAN_03;
            $var['db']['link'] = e_SELF . "?db";
        }
    }
    //	$lcnt = explode(",", e_LANLIST);
    //	if (count($lcnt) > 1)
    //	{
    $var['tools']['text'] = LANG_LAN_21;
    $var['tools']['link'] = e_SELF . "?tools";
    //	}
    e107::getNav()->admin(ADLAN_132, $action, $var);
}
Ejemplo n.º 18
0
 /**
  * Generic Admin Menu Generator
  * @return string
  */
 function renderMenu()
 {
     $tp = e107::getParser();
     $var = array();
     $selected = false;
     foreach ($this->adminMenu as $key => $val) {
         if (isset($val['perm']) && $val['perm'] !== '' && !getperms($val['perm'])) {
             continue;
         }
         $tmp = explode('/', trim($key, '/'), 3);
         // sync with mode/route access
         if (!$this->checkModeAccess($tmp[0]) || !$this->checkRouteAccess($tmp[0] . '/' . $tmp[1])) {
             continue;
         }
         // custom 'selected' check
         if (isset($val['selected']) && $val['selected']) {
             $selected = $val['selected'] === true ? $key : $val['selected'];
         }
         foreach ($val as $k => $v) {
             switch ($k) {
                 case 'caption':
                     $k2 = 'text';
                     $v = defset($v, $v);
                     break;
                 case 'url':
                     $k2 = 'link';
                     $v = $tp->replaceConstants($v, 'abs') . '?mode=' . $tmp[0] . '&amp;action=' . $tmp[1];
                     break;
                 case 'uri':
                     $k2 = 'link';
                     $v = $tp->replaceConstants($v, 'abs');
                     break;
                 default:
                     $k2 = $k;
                     break;
             }
             $var[$key][$k2] = $v;
         }
         // TODO slide down menu options?
         if (!vartrue($var[$key]['link'])) {
             $var[$key]['link'] = e_SELF . '?mode=' . $tmp[0] . '&amp;action=' . $tmp[1];
             // FIXME - URL based on $modes, remove url key
         }
         if (varset($val['tab'])) {
             $var[$key]['link'] .= "&amp;tab=" . $val['tab'];
         }
         /*$var[$key]['text'] = $val['caption'];
         		$var[$key]['link'] = (vartrue($val['url']) ? $tp->replaceConstants($val['url'], 'abs') : e_SELF).'?mode='.$tmp[0].'&action='.$tmp[1];
         		$var[$key]['perm'] = $val['perm'];	*/
         if (!empty($val['modal'])) {
             $var[$key]['link_class'] = ' e-modal';
             if (!empty($val['modal-caption'])) {
                 $var[$key]['link_data'] = array('data-modal-caption' => $val['modal-caption']);
             }
         }
     }
     if (empty($var)) {
         return '';
     }
     $request = $this->getRequest();
     if (!$selected) {
         $selected = $request->getMode() . '/' . $request->getAction();
     }
     $selected = vartrue($this->adminMenuAliases[$selected], $selected);
     return e107::getNav()->admin($this->menuTitle, $selected, $var);
 }
Ejemplo n.º 19
0
/**
 *
 */
function show_upload_filetypes()
{
    $ns = e107::getRender();
    $e_userclass = e107::getUserClass();
    if (!getperms("0")) {
        exit;
    }
    //TODO still needed?
    $definition_source = DOWLAN_71;
    $source_file = '';
    $edit_upload_list = varset($_POST['upload_do_edit'], false);
    if (isset($_POST['generate_filetypes_xml'])) {
        // Write back edited data to filetypes_.xml
        $file_text = "<e107Filetypes>\n";
        foreach ($_POST['file_class_select'] as $k => $c) {
            if (!isset($_POST['file_line_delete_' . $c]) && vartrue($_POST['file_type_list'][$k])) {
                $file_text .= "   <class name='{$c}' type='{$_POST['file_type_list'][$k]}' maxupload='" . vartrue($_POST['file_maxupload'][$k], ini_get('upload_max_filesize')) . "'/>\n";
            }
        }
        $file_text .= "</e107Filetypes>";
        if (($handle = fopen(e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES, 'wt')) == FALSE || fwrite($handle, $file_text) == FALSE || fclose($handle) == FALSE) {
            $text = DOWLAN_88 . e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES;
        } else {
            $text = DOWLAN_86 . e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES . '<br/>' . DOWLAN_87 . e_ADMIN . e_READ_FILETYPES . '<br/>';
        }
        $ns->tablerender(DOWLAN_49, $text);
    }
    $current_perms = array();
    if ($edit_upload_list && is_readable(e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES) || !$edit_upload_list && is_readable(e_ADMIN . e_READ_FILETYPES)) {
        require_once e_HANDLER . 'xml_class.php';
        $xml = new xmlClass();
        $xml->setOptArrayTags('class');
        $source_file = $edit_upload_list ? e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES : e_ADMIN . e_READ_FILETYPES;
        $temp_vars = $xml->loadXMLfile($source_file, true, false);
        if ($temp_vars === FALSE) {
            echo "Error parsing XML file!";
        } else {
            foreach ($temp_vars['class'] as $v1) {
                $v = $v1['@attributes'];
                $current_perms[$v['name']] = array('type' => $v['type'], 'maxupload' => $v['maxupload']);
            }
        }
    } elseif (is_readable(e_ADMIN . 'filetypes.php')) {
        $source_file = 'filetypes.php';
        $current_perms[e_UC_MEMBER] = array('type' => implode(',', array_keys(get_allowed_filetypes('filetypes.php', ''))), 'maxupload' => '2M');
        if (is_readable(e_ADMIN . 'admin_filetypes.php')) {
            $current_perms[e_UC_ADMIN] = array('type' => implode(',', array_keys(get_allowed_filetypes('admin_filetypes.php', ''))), 'maxupload' => '2M');
            $source_file .= ' + admin_filetypes.php';
        }
    } else {
        // Set a default
        $current_perms[e_UC_MEMBER] = array('type' => 'zip,tar,gz,jpg,png', 'maxupload' => '2M');
    }
    $frm = new e_form(true);
    //enable inner tabindex counter
    $columnInfo = array("ftypes_userclass" => array("title" => DOWLAN_73, "type" => "", "width" => "auto", "thclass" => "", "forced" => true), "ftypes_extension" => array("title" => DOWLAN_74, "type" => "", "width" => "auto", "thclass" => ""), "ftypes_max_size" => array("title" => DOWLAN_75, "type" => "", "width" => "auto", "thclass" => ""), "ftypes_confirm_del" => array("title" => DOWLAN_76, "type" => "", "width" => "auto", "thclass" => "last"));
    $filterColumns = array("ftypes_userclass", "ftypes_extension", "ftypes_max_size", "ftypes_confirm_del");
    $text = "\n         <form method='post' action='" . e_SELF . "?filetypes'>\n            <fieldset id='core-download-upload1'>\n               <div>\n                  <div>\n                     <input type='hidden' name='upload_do_edit' value='1'/><p>" . str_replace(array('--SOURCE--', '--DEST--'), array(e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES, e_ADMIN . e_READ_FILETYPES), DOWLAN_85) . "</p><p>" . DOWLAN_72 . $source_file . "\n                  </p></div>\n                  <table class='table adminform'>" . $frm->colGroup($columnInfo) . $frm->thead($columnInfo, $filterColumns) . "\n                     <tbody>\n      ";
    foreach ($current_perms as $uclass => $uinfo) {
        $text .= "\n            <tr>\n               <td>\n                  <select name='file_class_select[]' class='tbox'>\n                     " . $e_userclass->vetted_tree('file_class_select', array($e_userclass, 'select'), $uclass, 'member,main,classes,admin, no-excludes') . "\n                  </select>\n               </td>\n               <td><input type='text' name='file_type_list[]' value='{$uinfo['type']}' class='tbox' size='40'/></td>\n               <td><input type='text' name='file_maxupload[]' value='{$uinfo['maxupload']}' class='tbox' size='10'/></td>\n               <td><input type='checkbox' value='1' name='file_line_delete_{$uclass}'/></td>\n            </tr>\n         ";
    }
    // Now put up a box to add a new setting
    $text .= "\n                        <tr>\n                           <td colspan='" . count($columnInfo) . "'>" . DOWLAN_90 . "</td>\n                        </tr>\n                        <tr>\n                           <td><select name='file_class_select[]' class='tbox'>\n                           " . $e_userclass->vetted_tree('file_class_select', array($e_userclass, 'select'), '', 'member,main,classes,admin,blank, no-excludes') . "\n                           </select></td>\n                           <td><input type='text' name='file_type_list[]' value='' class='tbox' size='40'/></td>\n                           <td colspan='2'><input type='text' name='file_maxupload[]' value='" . ini_get('upload_max_filesize') . "' class='tbox' size='10'/></td>\n                        </tr>\n                     </tbody>\n                  </table>\n               </div>\n            </fieldset>\n            <div class='buttons-bar center'>\n               <input class='btn btn-default button' type='submit' name='generate_filetypes_xml' value='" . DOWLAN_77 . "'/>\n               </div>\n        \t\t</form>\n      ";
    $ns->tablerender(DOWLAN_23, $text);
}
Ejemplo n.º 20
0
<?php

/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 */
require_once "../class2.php";
if (!getperms("M")) {
    header("location:" . e_BASE . "index.php");
    exit;
}
e107::lan('core', 'wmessage', true);
class wmessage_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'generic_ui', 'path' => null, 'ui' => 'generic_form_ui', 'uipath' => null));
    protected $adminMenu = array('main/list' => array('caption' => LAN_MANAGE, 'perm' => 'P'), 'main/create' => array('caption' => LAN_CREATE, 'perm' => 'P'), 'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'));
    protected $adminMenuAliases = array('main/edit' => 'main/list');
    protected $menuTitle = WMLAN_00;
}
class generic_ui extends e_admin_ui
{
    protected $pluginTitle = WMLAN_00;
    protected $pluginName = 'core';
    protected $eventName = 'wmessage';
    protected $table = 'generic';
    protected $pid = 'gen_id';
    protected $perPage = 10;
Ejemplo n.º 21
0
 function getConfig($config = false)
 {
     $tp = e107::getParser();
     $fl = e107::getFile();
     if (getperms('0')) {
         $template = "mainadmin.xml";
     } elseif (ADMIN) {
         $template = "admin.xml";
     } elseif (USER) {
         $template = "member.xml";
     } else {
         $template = "public.xml";
     }
     $configPath = is_readable(THEME . "templates/tinymce/" . $template) ? THEME . "templates/tinymce/" . $template : e_PLUGIN . "tinymce4/templates/" . $template;
     $config = e107::getXml()->loadXMLfile($configPath, true);
     //TODO Cache!
     $this->configName = $config['@attributes']['name'];
     unset($config['@attributes']);
     $ret = array('selector' => '.e-wysiwyg', 'theme' => 'modern', 'plugins' => $this->filter_plugins($config['tinymce_plugins']), 'language' => $this->tinymce_lang());
     // Loop thru XML parms.
     foreach ($config as $k => $xml) {
         $ret[$k] = $xml;
     }
     $tPref = e107::pref('tinymce4');
     if (!empty($tPref['paste_as_text'])) {
         $ret['paste_as_text'] = true;
     }
     if (!empty($tPref['browser_spellcheck'])) {
         $ret['browser_spellcheck'] = true;
     }
     $formats = array('hilitecolor' => array('inline' => 'span', 'classes' => 'hilitecolor', 'styles' => array('backgroundColor' => '%value')));
     //@see http://www.tinymce.com/wiki.php/Configuration:formats
     $formats = "[\n                {title: 'Headers', items: [\n                    {title: 'Heading 1', block: 'h1'},\n                    {title: 'Heading 2', block: 'h2'},\n                    {title: 'Heading 3', block: 'h3'},\n                    {title: 'Heading 4', block: 'h4'},\n                    {title: 'Heading 5', block: 'h5'},\n                    {title: 'Heading 6', block: 'h6'}\n                ]},\n\n                {title: 'Inline', items: [\n                    {title: 'Bold', inline: 'b', icon: 'bold'},\n                    {title: 'Italic', inline: 'em', icon: 'italic'},\n                    {title: 'Underline', inline: 'span', styles : {textDecoration : 'underline'}, icon: 'underline'},\n                    {title: 'Strikethrough', inline: 'span', styles : {textDecoration : 'line-through'}, icon: 'strikethrough'},\n                    {title: 'Superscript', inline: 'sup', icon: 'superscript'},\n                    {title: 'Subscript', inline: 'sub', icon: 'subscript'},\n                    {title: 'Code', inline: 'code', icon: 'code'},\n                    {title: 'Small', inline: 'small', icon: ''},\n                ]},\n\n                {title: 'Blocks', items: [\n                    {title: 'Paragraph', block: 'p'},\n                    {title: 'Blockquote', block: 'blockquote'},\n                    {title: 'Div', block: 'div'},\n                    {title: 'Pre', block: 'pre'},\n                    {title: 'Code Highlighted', block: 'pre', classes: 'prettyprint linenums' }\n                ]},\n\n                {title: 'Alignment', items: [\n                    {title: 'Left', block: 'div', classes: 'text-left',  icon: 'alignleft'},\n                    {title: 'Center', block: 'div',classes: 'text-center', icon: 'aligncenter'},\n                    {title: 'Right', block: 'div', classes: 'text-right',  icon: 'alignright'},\n                    {title: 'Justify', block: 'div', classes: 'text-justify', icon: 'alignjustify'},\n                    {title: 'No-Wrap', block: 'div', classes: 'text-nowrap', icon: ''},\n                    {title: 'Image Left', selector: 'img', classes: 'pull-left', styles: {'margin': '0 10px 5px 0'  },  icon: 'alignleft'},\n                    {title: 'Image Right', selector: 'img', classes: 'pull-right', styles: { 'margin': '0 0 5px 10px'}, icon: 'alignright'}\n\n                ]},\n\n                {title: 'Bootstrap Inline', items: [\n\t\t\t\t {title: 'Label (Default)', inline: 'span', classes: 'label label-default'},\n\t\t\t\t {title: 'Label (Primary)', inline: 'span', classes: 'label label-primary'},\n                 {title: 'Label (Success)', inline: 'span', classes: 'label label-success'},\n                 {title: 'Label (Info)', inline: 'span', classes: 'label label-info'},\n                 {title: 'Label (Warning)', inline: 'span', classes: 'label label-warning'},\n                 {title: 'Label (Danger)', inline: 'span', classes: 'label label-danger'},\n                 {title: 'Muted', inline: 'span', classes: 'text-muted'},\n                ]},\n\n                 {title: 'Bootstrap Blocks', items: [\n                 {title: 'Alert (Success)', block: 'div', classes: 'alert alert-success'},\n                 {title: 'Alert (Info)', block: 'div', classes: 'alert alert-info'},\n                 {title: 'Alert (Warning)', block: 'div', classes: 'alert alert-warning'},\n                 {title: 'Alert (Danger)', block: 'div', classes: 'alert alert-block alert-danger'},\n                 {title: 'Float Clear', block: 'div', classes: 'clearfix'},\n                 {title: 'Lead', block: 'p', classes: 'lead'},\n                 {title: 'Well', block: 'div', classes: 'well'},\n                 {title: '1/4 Width Block', block: 'div', classes: 'col-md-3 col-sm-12'},\n                 {title: '3/4 Width Block', block: 'div', classes: 'col-md-9 col-sm-12'},\n                 {title: '1/3 Width Block', block: 'div', classes: 'col-md-4 col-sm-12'},\n                 {title: '2/3 Width Block', block: 'div', classes: 'col-md-8 col-sm-12'},\n                 {title: '1/2 Width Block', block: 'div', classes: 'col-md-6 col-sm-12'},\n                ]},\n\n                 {title: 'Bootstrap Buttons', items: [\n                 {title: 'Button (Default)', selector: 'a', classes: 'btn btn-default'},\n\t\t\t\t {title: 'Button (Primary)', selector: 'a', classes: 'btn btn-primary'},\n                 {title: 'Button (Success)', selector: 'a', classes: 'btn btn-success'},\n                 {title: 'Button (Info)', selector: 'a', classes: 'btn btn-info'},\n                 {title: 'Button (Warning)', selector: 'a', classes: 'btn-warning'},\n                 {title: 'Button (Danger)', selector: 'a', classes: 'btn-danger'},\n                ]},\n\n\t\t\t\t {title: 'Bootstrap Images', items: [\n\t\t\t\t {title: 'Responsive (recommended)',  selector: 'img', classes: 'img-responsive'},\n\t\t\t\t {title: 'Rounded',  selector: 'img', classes: 'img-rounded'},\n\t\t\t\t {title: 'Circle', selector: 'img', classes: 'img-circle'},\n                 {title: 'Thumbnail', selector: 'img', classes: 'img-thumbnail'},\n                ]},\n\n\t\t\t\t {title: 'Bootstrap Tables', items: [\n\t\t\t\t {title: 'Bordered',  selector: 'table', classes: 'table-bordered'},\n\t\t\t\t {title: 'Condensed', selector: 'table', classes: 'table-condensed'},\n\t\t\t\t {title: 'Hover', selector: 'table', classes: 'table-hover'},\n                 {title: 'Striped', selector: 'table', classes: 'table-striped'},\n                ]},\n\n\n            ]";
     //	$ret['style_formats_merge'] = true;
     //	$ret['visualblocks_default_state'] = true; //pref
     $ret['style_formats'] = $formats;
     // json_encode($formats);
     $ret['link_class_list'] = "[\n        {title: 'None', value: ''},\n        {title: 'Link', value: 'btn btn-link'},\n        {title: 'Alert Link', value: 'alert-link'},\n        {title: 'Button (Default)', value: 'btn btn-default'},\n        {title: 'Button (Primary)', value: 'btn btn-primary'},\n        {title: 'Button (Success)', value: 'btn btn-success'},\n        {title: 'Button (Info)', value: 'btn btn-info'},\n        {title: 'Button (Warning)', value: 'btn btn-warning'},\n        {title: 'Button (Danger)', value: 'btn btn-danger'}\n    ]";
     // https://github.com/valtlfelipe/TinyMCE-LocalAutoSave
     /*
     		$ret['setup'] = "function(ed) {
           ed.addMenuItem('test', {
              text: 'Clear Floats',
              context: 'insert',
              icon: false,
              onclick: function() {
                 ed.insertContent('<br class=\"clearfix\" />');
              }
           });
           }";
     */
     // e107 Bbcodes.
     /*
     
     		$ret['setup'] = "function(ed) {
     			ed.addButton('e107-bbcode', {
     				text: 'bbcode',
     				icon: 'emoticons',
     				onclick: function() {
     		// Open window
     
     			ed.windowManager.open({
     						title: 'Example plugin',
     						body: [
     							{type: 'listbox', name: 'code', label: 'BbCode', values: [
     								{text: 'Left', value: 'left'},
     						        {text: 'Right', value: 'right'},
     						        {text: 'Center', value: 'center'}
     						    ]},
                                 {type: 'textbox', name: 'parm', label: 'Parameters'}
     						],
     						onsubmit: function(e) {
     
     							var selected = ed.selection.getContent({format : 'text'});
     
     						//	alert(selected);
     							// Insert content when the window form is submitted
     							ed.insertContent('[' + e.data.code + ']' + selected + '[/' + e.data.code + ']');
     						}
     					});
     				}
     			});
     	}";
     */
     // Emoticon Support @see //https://github.com/nhammadi/Smileys
     if (e107::pref('core', 'smiley_activate', false)) {
         $emo = e107::getConfig("emote")->getPref();
         $pack = e107::pref('core', 'emotepack');
         $emotes = array();
         $i = 0;
         $c = 0;
         foreach ($emo as $path => $co) {
             $codes = explode(" ", $co);
             $url = SITEURLBASE . e_IMAGE_ABS . "emotes/" . $pack . "/" . str_replace("!", ".", $path);
             $emotes[$i][] = array('shortcut' => $codes, 'url' => $url, 'title' => ucfirst($path));
             if ($c == 6) {
                 $i++;
                 $c = 0;
             } else {
                 $c++;
             }
         }
         //	print_r($emotes);
         $ret['extended_smileys'] = json_encode($emotes);
     }
     //	$ret['skin']                    = 'e107admin';
     //	$ret['skin_url']                = SITEURLBASE.e_PLUGIN_ABS.'tinymce4/skins/e107admin';
     $ret['convert_fonts_to_spans'] = false;
     $ret['content_css'] = e_PLUGIN_ABS . 'tinymce4/editor.css,https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css,http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css';
     $ret['relative_urls'] = false;
     //Media Manager prefers it like this.
     $ret['preformatted'] = true;
     $ret['document_base_url'] = SITEURL;
     //	$ret['table_default_attributes'] = json_encode(array('class'=>'table table-striped' ));
     if (!empty($ret['templates'])) {
         $ret['templates'] = $tp->replaceConstants($ret['templates'], 'abs');
         // $this->getTemplates();
     }
     //	$this->config['verify_css_classes']	= 'false';
     $text = array();
     foreach ($ret as $k => $v) {
         if ($k == 'external_plugins') {
             $text[] = 'external_plugins: ' . $this->getExternalPlugins($v);
             continue;
         }
         $text[] = $k . ': ' . $this->convertBoolean($v);
     }
     $this->config = implode(",\n", $text);
     return;
     // -------------------------------------------------------------------------------------
     $cssFiles = $fl->get_files(THEME, "\\.css", '', 2);
     foreach ($cssFiles as $val) {
         $css[] = str_replace(THEME, THEME_ABS, $val['path'] . $val['fname']);
     }
     $css[] = "{e_WEB_ABS}js/bootstrap/css/bootstrap.min.css";
     $content_css = vartrue($config['content_css'], implode(",", $css));
     $content_styles = array('Bootstrap Button' => 'btn btn-primary', 'Bootstrap Table' => 'table');
     $this->config += array('dialog_type' => "modal", 'theme_advanced_resizing' => 'true', 'remove_linebreaks' => 'false', 'extended_valid_elements' => vartrue($config['extended_valid_elements']), 'apply_source_formatting' => 'true', 'invalid_elements' => 'font,align,script,applet', 'auto_cleanup_word' => 'true', 'cleanup' => 'true', 'convert_fonts_to_spans' => 'true', 'popup_css' => 'false', 'trim_span_elements' => 'true', 'inline_styles' => 'true', 'auto_resize' => 'false', 'debug' => 'true', 'force_br_newlines' => 'true', 'media_strict' => 'false', 'width' => vartrue($config['width'], '100%'), 'forced_root_block' => 'false', 'convert_newlines_to_brs' => 'true', 'entity_encoding' => 'raw', 'convert_fonts_to_styles' => 'true', 'remove_script_host' => 'true', 'relative_urls' => 'false', 'preformatted' => 'true', 'document_base_url' => SITEURL, 'verify_css_classes' => 'false');
     //		$this->config['cleanup_callback'] = 'tinymce_e107Paths';
     $paste_plugin = false;
     // (strpos($config['tinymce_plugins'],'paste')!==FALSE) ? TRUE : FALSE;
     if ($paste_plugin) {
         $this->config += array('paste_text_sticky' => 'true', 'paste_text_sticky_default' => 'true', 'paste_text_linebreaktype' => 'br', 'remove_linebreaks' => 'false', 'paste_create_paragraphs' => 'false', 'paste_create_linebreaks' => 'true', 'paste_use_dialog' => 'true', 'paste_auto_cleanup_on_paste' => 'true', 'paste_convert_middot_lists' => 'false', 'paste_unindented_list_class' => 'unindentedList', 'paste_convert_headers_to_strong' => 'true', 'paste_insert_word_content_callback' => 'convertWord', 'auto_cleanup_word' => 'true');
     }
     if (ADMIN) {
         //		$this->config['external_link_list_url'] = e_PLUGIN_ABS."tiny_mce/filelist.php";
     }
 }
Ejemplo n.º 22
0
            require_once THEME . 'templates/login_template.php';
        } elseif (file_exists(THEME . 'login_template.php')) {
            require_once THEME . 'login_template.php';
        } else {
            require_once e_CORE . "templates/login_template.php";
        }
    }
    $sc = e107::getScBatch('login');
    if (deftrue('BOOTSTRAP') && isset($LOGIN_TEMPLATE['page'])) {
        $LOGIN_TABLE_HEADER = $LOGIN_TEMPLATE['page']['header'];
        $LOGIN_TABLE = "<form class='form-signin' method='post' action='" . e_SELF . "' onsubmit='hashLoginPassword(this)' >" . $LOGIN_TEMPLATE['page']['body'] . "</form>";
        $LOGIN_TABLE_FOOTER = $LOGIN_TEMPLATE['page']['footer'];
    }
    $text = $tp->parseTemplate($LOGIN_TABLE, true, $sc);
    //	$text = preg_replace("/\{(.*?)\}/e", 'varset($\1,"\1")', $LOGIN_TABLE);
    if (getperms('0')) {
        echo "<div class='alert alert-block alert-error alert-danger center'> You are currently logged in.</div>";
    }
    //	echo preg_replace("/\{(.*?)\}/e", 'varset($\1,"\1")', $LOGIN_TABLE_HEADER);
    $login_message = SITENAME;
    //	$login_message = LAN_LOGIN_3." | ".SITENAME;
    echo LOGINMESSAGE;
    echo $tp->parseTemplate($LOGIN_TABLE_HEADER, $sc);
    $ns->tablerender($login_message, $text, 'login_page');
    echo $tp->parseTemplate($LOGIN_TABLE_FOOTER, $sc);
    // echo preg_replace("/\{([^ ]*?)\}/e", 'varset($\1,"\1")', $LOGIN_TABLE_FOOTER);
}
require_once FOOTERF;
exit;
//echo "</body></html>";
// $sql->db_Close();
Ejemplo n.º 23
0
<?php

// Generated e107 Plugin Admin Area
require_once '../../class2.php';
if (!getperms('P')) {
    header('location:' . e_BASE . 'index.php');
    exit;
}
class social_adminarea extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'social_ui', 'path' => null, 'ui' => 'social_form_ui', 'uipath' => null));
    protected $adminMenu = array('main/configure' => array('caption' => LAN_CONFIGURE, 'perm' => 'P'), 'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'));
    protected $adminMenuAliases = array('main/edit' => 'main/list');
    protected $menuTitle = 'Social';
}
class social_ui extends e_admin_ui
{
    protected $pluginTitle = 'Social';
    protected $pluginName = 'social';
    //	protected $eventName		= 'social-social'; // remove comment to enable event triggers in admin.
    //	protected $table			= 'social';
    //	protected $pid				= 'interview_id';
    protected $perPage = 10;
    protected $batchDelete = true;
    //	protected $batchCopy		= true;
    //	protected $sortField		= 'somefield_order';
    //	protected $orderStep		= 10;
    //	protected $tabs				= array('Tabl 1','Tab 2'); // Use 'tab'=>0  OR 'tab'=>1 in the $fields below to enable.
    //	protected $listQry      	= "SELECT * FROM `#tableName` WHERE field != '' "; // Example Custom Query. LEFT JOINS allowed. Should be without any Order or Limit.
    protected $listOrder = '';
    protected $fields = array();
Ejemplo n.º 24
0
 /**
  * {ADMINOPTIONS: class=x}
  */
 function sc_adminoptions($parm = array())
 {
     $tp = e107::getParser();
     if (ADMIN && getperms('H')) {
         //TODO - discuss - a pref for 'new browser window' loading, or a parm or leave 'new browser window' as default?
         $default = deftrue('BOOTSTRAP') ? $tp->toGlyph('icon-edit', false) : "<img src='" . e_IMAGE_ABS . "admin_images/edit_16.png' alt='" . LAN_NEWS_25 . "' class='icon' />";
         $adop_icon = file_exists(THEME . "images/newsedit.png") ? "<img src='" . THEME_ABS . "images/newsedit.png' alt='" . LAN_NEWS_25 . "' class='icon' />" : $default;
         $class = varset($parm['class']);
         return "<a class='e-tip " . $class . "' rel='external' href='" . e_ADMIN_ABS . "newspost.php?action=edit&amp;id=" . $this->news_item['news_id'] . "' title=\"" . LAN_NEWS_25 . "\">" . $adop_icon . "</a>\n";
     } else {
         return '';
     }
 }
Ejemplo n.º 25
0
 * $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/admin_prefs.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
/*
Notes:
- array_flip method deprecated for delete item detection.
- using form handler is deprecated and present only for backwards compatibility.
- using generic terms like EDIT and DELETE in Language file is deprecated, use LAN_EDIT etc. instead.
- using terms like created, update, options etc..deprecated should use built in terms.
- generic admin icons used. ADMIN_ICON_EDIT etc.
- using $caption = "whatever", is unneccessary.
*/
require_once "../../class2.php";
if (!getperms("P") || !e107::isInstalled('rss_menu')) {
    header("location:" . e_BASE . "index.php");
    exit;
}
include_lan(e_PLUGIN . "rss_menu/languages/" . e_LANGUAGE . "_admin_rss_menu.php");
// XXX THIS IS SET UP FOR LATER USE.
class rss_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'rss_ui', 'path' => null, 'ui' => 'rss_form_ui', 'uipath' => null));
    protected $adminMenu = array('main/list' => array('caption' => LAN_MANAGE, 'perm' => 'P'), 'main/import' => array('caption' => "Add New Feed", 'perm' => 'P'), 'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'));
    protected $adminMenuAliases = array('main/edit' => 'main/list');
    protected $menuTitle = 'RSS';
    function init()
    {
        if (E107_DEBUG_LEVEL > 0) {
            $this->adminMenu['main/create'] = array('caption' => "Add Custom Feed", 'perm' => 'P');
Ejemplo n.º 26
0
<?php

/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * Plugin administration area
 *
 */
require_once "../class2.php";
if (!getperms("Z")) {
    e107::redirect('admin');
    exit;
}
e107::coreLan('plugin', true);
$e_sub_cat = 'plug_manage';
define('PLUGIN_SHOW_REFRESH', FALSE);
define('PLUGIN_SCAN_INTERVAL', !empty($_SERVER['E_DEV']) ? 0 : 360);
global $user_pref;
require_once e_HANDLER . 'plugin_class.php';
require_once e_HANDLER . 'file_class.php';
$plugin = new e107plugin();
$pman = new pluginManager();
define("e_PAGETITLE", ADLAN_98 . " - " . $pman->pagetitle);
if (e_AJAX_REQUEST) {
    print_a($_POST);
    print_a($_GET);
    exit;
Ejemplo n.º 27
0
$gen = new convert();
$fVars->FORUMTITLE = LAN_PLUGIN_FORUM_NAME;
$fVars->THREADTITLE = LAN_FORUM_0002;
$fVars->REPLYTITLE = LAN_FORUM_0003;
$fVars->LASTPOSTITLE = LAN_FORUM_0004;
$fVars->INFOTITLE = LAN_FORUM_0009;
$fVars->LOGO = IMAGE_e;
$fVars->NEWTHREADTITLE = LAN_FORUM_0075;
$fVars->POSTEDTITLE = LAN_FORUM_0074;
$fVars->NEWIMAGE = IMAGE_new_small;
$fVars->TRACKTITLE = LAN_FORUM_0073;
$rules_text = forum_rules('check');
$fVars->USERINFO = "<a href='" . e_BASE . "top.php?0.top.forum.10'>" . LAN_FORUM_0010 . "</a> | <a href='" . e_BASE . "top.php?0.active'>" . LAN_FORUM_0011 . "</a>";
if (USER) {
    $fVars->USERINFO .= " | <a href='" . e_BASE . 'userposts.php?0.forums.' . USERID . "'>" . LAN_FORUM_0012 . "</a> | <a href='" . e_BASE . "usersettings.php'>" . LAN_FORUM_0013 . "</a> | <a href='" . e_HTTP . "user.php ?id." . USERID . "'>" . LAN_FORUM_0014 . "</a>";
    if ($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) {
        $fVars->USERINFO .= " | <a href='" . e_PLUGIN . "forum/forum_uploads.php'>" . LAN_FORUM_0015 . "</a>";
    }
}
if (!empty($rules_text)) {
    $fVars->USERINFO .= " | <a href='" . e107::url('forum', 'rules') . "'>" . LAN_FORUM_0016 . '</a>';
}
// v2.x --------------------
$uInfo = array();
$uInfo[0] = "<a href='" . e107::url('forum', 'stats') . "'>" . LAN_FORUM_6013 . '</a>';
if (!empty($rules_text)) {
    $uInfo[1] = "<a href='" . e107::url('forum', 'rules') . "'>" . LAN_FORUM_0016 . '</a>';
}
$fVars->USERINFOX = implode(" | ", $uInfo);
// -----------
$total_topics = $sql->count("forum_thread", "(*)");
Ejemplo n.º 28
0
 function mediaSelectUpload($type = 'image')
 {
     $frm = e107::getForm();
     $videoActive = 'inactive';
     $options = array();
     $options['bbcode'] = $this->getQuery('bbcode') == 'img' ? 'img' : FALSE;
     $text = "<ul id='admin-ui-media-manager' class='nav nav-tabs'>\n";
     if ($this->getQuery('bbcode') != 'video' && $this->getQuery('bbcode') != 'glyph') {
         $text .= "<li class='active'><a data-toggle='tab' href='#core-media-select'>Choose from Library</a></li>\n";
     } else {
         if ($this->getQuery('bbcode') == 'glyph') {
             $glyphActive = 'active';
         } else {
             $videoActive = 'active';
         }
     }
     if (getperms('A|A1') && ($this->getQuery('bbcode') != 'video' && $this->getQuery('bbcode') != 'glyph')) {
         $text .= "<li><a data-toggle='tab' href='#core-media-upload'>Upload a File</a></li>";
     }
     if (varset($options['bbcode']) == 'img') {
         $text .= "<li><a data-toggle='tab' href='#core-media-style'>Appearance</a></li>\n";
     }
     if ($this->getQuery('glyphs') == 1 || $this->getQuery('bbcode') == 'glyph') {
         $text .= "<li class='{$glyphActive}'><a data-toggle='tab' href='#core-media-glyphs'>Glyphs</a></li>\n";
     }
     if ($this->getQuery('video') == 1 || $this->getQuery('bbcode') == 'video') {
         $text .= "<li class='{$videoActive}'><a data-toggle='tab' href='#core-media-video'>Youtube</a></li>\n";
     }
     if (varset($_GET['from'])) {
         $options['from'] .= intval($_GET['from']);
     }
     $text .= "\n\t\t\t</ul>\n\t\t\t<div class='tab-content media-manager'>";
     if ($this->getQuery('bbcode') != 'video' && $this->getQuery('bbcode') != 'glyph') {
         $text .= "<div class='tab-pane active' id='core-media-select'>\t\t\t\n\t\t\t\t\t<div class='table' style='display:block'>";
         $text .= $this->imageTab($type, $options);
         $text .= "</div></div>";
     }
     $text .= "<div class='tab-pane' id='core-media-upload'>\n\t\t\t";
     $this->fields['media_category']['readonly'] = TRUE;
     $this->fields['media_url']['noedit'] = TRUE;
     $this->fields['media_userclass']['noedit'] = TRUE;
     if (getperms('A|A1')) {
         $text .= $this->uploadTab();
         // To test upload script with plupload
     }
     //	$text .=  $this->CreatePage(); // comment me out to test plupload
     $text .= "\t\n\t\t\t</div>";
     /* In BBCODE-Mode this dialog rerturns an [img] bbcode to the 'tagid' container with the appropriate parms generated. 
      * eg. [img style=float:left;margin-right:3px]{e_MEDIA_IMAGE}someimage.jpg[/img]
      * Then the dialog may be used as a bbcode img popup and within TinyMce also. 
      * 
      */
     if ($options['bbcode']) {
         $text .= "<div class='tab-pane' id='core-media-style'>\n\t\t\t\t\n\t\t\t\t<div class='row'>\n\t\t\t\t<div class='col-md-6 span6'>\n\t\t\t\t<table class='table'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t<col class='col-control' />\n\t\t\t\t</colgroup>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Dimensions: </td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type='text' class='e-media-attribute' id='width' name='width' size='4' style='width:50px' value='' /> px\n\t\t\t\t\t\t X <input type='text' class='e-media-attribute' id='height' name='height' size='4' style='width:50px' value=''  /> px\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Text flow: </td>\n\t\t\t\t\t\t<td>" . $frm->selectbox('float', array('default' => 'Default', 'left' => "Left", 'right' => 'Right')) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Margin-Left: </td>\n\t\t\t\t\t\t<td><input class='e-media-attribute input-mini' type='text' id='margin-left' name='margin_left' value='' /> px</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Margin-Right: </td>\n\t\t\t\t\t\t<td><input class='e-media-attribute input-mini' type='text' id='margin-right' name='margin_right' value=''  /> px</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Margin-Top: </td>\n\t\t\t\t\t\t<td><input class='e-media-attribute input-mini' type='text' id='margin-top' name='margin_top' value=''  /> px</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Margin-Bottom: </td>\n\t\t\t\t\t\t<td><input class='e-media-attribute input-mini' type='text' id='margin-bottom' name='margin_bottom' value=''  /> px</td>\n\t\t\t\t\t</tr>\n\t\t\n\t\t\t</tbody></table>\n\t\t\t</div>\n\t\t\t<div class='col-md-6 span6'>\n\t\t\t<h5>Preview</h5>\n\t\t\n\t\t\t<img class='well' id='preview' src='" . e_IMAGE_ABS . "generic/blank.gif' style='min-width:220px; min-height:180px;' />\n\t\t\t\n\t\t\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>";
     }
     if ($this->getQuery('glyphs') == 1 || $this->getQuery('bbcode') == 'glyph') {
         //TODO
         $text .= "<div class='tab-pane clearfix {$glyphActive}' id='core-media-glyphs' style='font-size:24px'>";
         $text .= $this->glyphTab();
         $text .= "</div>\n\t\t\t";
     }
     if ($this->getQuery('video') || $this->getQuery('bbcode') == 'video') {
         $text .= "<div class='tab-pane clearfix {$videoActive}' id='core-media-video' >";
         //	$text .= "<div class='row-fluid'>";
         $text .= $this->videoTab();
         $text .= "</div>";
         //	$text .= "</div>";
     }
     $text .= "</div>";
     // For BBCODE mode. //TODO image-float.
     if ($options['bbcode'] || E107_DEBUG_LEVEL > 0) {
         $text .= "<div style='text-align:right;padding:5px'>\n\t\t\t\n\t\t\t<button type='submit' class='btn btn-success submit e-dialog-save e-dialog-close' data-bbcode='" . $options['bbcode'] . "' data-target='" . $this->getQuery('tagid') . "' name='save_image' value='Save it'  >\n\t\t\t<span>Save</span>\n\t\t\t</button>\n\t\t\t<button type='submit' class=' btn btn-default submit e-dialog-close' name='cancel_image' value='Cancel' >\n\t\t\t<span>Cancel</span>\n\t\t\t</button>\n\t\t\t</div>";
     }
     $type = E107_DEBUG_LEVEL > 0 ? "text" : "hidden";
     $br = E107_DEBUG_LEVEL > 0 ? "<br />" : "";
     $text .= "\n\t\t" . $br . "<input title='bbcode' type='{$type}' readonly='readonly' class='span11' id='bbcode_holder' name='bbcode_holder' value='' />\n\t\t" . $br . "<input title='html/wysiwyg' type='{$type}' class='span11' readonly='readonly' id='html_holder' name='html_holder' value='' />\n\t\t" . $br . "<input title='(preview) src' type='{$type}' class='span11' readonly='readonly' id='src' name='src' value='' />\n\t\t" . $br . "<input title='path (saved to db)' type='{$type}' class='span11' readonly='readonly' id='path' name='path' value='' />\t\t\t\t\n\t\t";
     return $text;
 }
Ejemplo n.º 29
0
<?php

/*
+---------------------------------------------------------------+
|        e107 website system
|        Easy Admin Page by Cameron. (www.e107coders.org)
|        a part of Your_plugin v3.0
|        Released under the terms and conditions of the
|        GNU General Public License (http://gnu.org).
|		 Suitable only for e107 v0.7
+---------------------------------------------------------------+
*/
require_once "../../class2.php";
if (!getperms("P")) {
    header("location:" . e_BASE . "index.php");
    exit;
}
include_lan(e_PLUGIN . "metaweblog/languages/" . e_LANGUAGE . ".php");
require_once e_ADMIN . "auth.php";
$text .= XMLRPC_HELP_011;
$ns->tablerender(XMLRPC_CONFIG_001, $text);
require_once e_ADMIN . "footer.php";
Ejemplo n.º 30
0
 /**
  * Update user (admin) permissions.
  * NOTE: exit if $uid is not an integer or is 0.
  *
  * @param integer $uid
  * @param array $permArray eg. array('A', 'K', '1');
  * @return void
  */
 function updatePerms($uid, $permArray)
 {
     global $admin_log;
     $sql = e107::getDb();
     $tp = e107::getParser();
     $modID = intval($uid);
     $mes = e107::getMessage();
     if ($modID == 0) {
         $mes->addError("Malfunction at line " . __LINE__ . " of user_handler.php");
         return;
     }
     $sysuser = e107::getSystemUser($modID, false);
     $row = $sysuser->getData();
     $a_name = $row['user_name'];
     $perm = "";
     foreach ($permArray as $value) {
         $value = $tp->toDB($value);
         if ($value == "0") {
             if (!getperms('0')) {
                 $value = "";
                 break;
             }
             $perm = "0";
             break;
         }
         if ($value) {
             $perm .= $value . ".";
         }
     }
     //$sql->db_Update("user", "user_perms='{$perm}' WHERE user_id='{$modID}' ")
     if (!$sysuser->isAdmin()) {
         $sysuser->set('user_admin', 1)->save();
         $lan = str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_164);
         e107::getLog()->add('USET_08', $lan, E_LOG_INFORMATIVE);
     }
     e107::getMessage()->addAuto($sysuser->set('user_perms', $perm)->save(), 'update', sprintf(LAN_UPDATED, $tp->toDB($_POST['ad_name'])), false, false);
     $logMsg = str_replace(array('--ID--', '--NAME--'), array($modID, $a_name), ADMSLAN_72) . $perm;
     e107::getLog()->add('ADMIN_01', $logMsg, E_LOG_INFORMATIVE, '');
 }