1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-28 16:50:07 +02:00

Updating of deprecated method usage. Removal of old files. Log tests added.

This commit is contained in:
Cameron
2020-12-18 09:39:02 -08:00
parent 582c48fc21
commit f5153bf640
55 changed files with 509 additions and 3218 deletions

View File

@@ -357,7 +357,7 @@ class admin_log_ui extends e_admin_ui
// Add in a log event
$message = $db_name.str_replace(array('[x]', '[y]'), array($old_string, $del_count), RL_LAN_057);
$mes->addSuccess($message);
$log->log_event($db_msg, "db_Delete - earlier than {$old_string} (past {$back_count} days)[!br!]".$message.'[!br!]'.$db_table.' '.$qry, E_LOG_INFORMATIVE, '');
$log->add($db_msg, "db_Delete - earlier than {$old_string} (past {$back_count} days)[!br!]".$message.'[!br!]'.$db_table.' '.$qry, E_LOG_INFORMATIVE, '');
}
else
{

View File

@@ -148,7 +148,7 @@ else
if ($row[0] == "authfail")
{
$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
$admin_log->addEvent(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
e107::getRedirect()->redirect('admin.php?failed');
@@ -458,7 +458,7 @@ class auth
$text = 'CHAP: '.$username.' ('.$extra_text.')';
$title = e107::getParser()->toDB($title);
$text = e107::getParser()->toDB($text);
e107::getAdminLog()->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", $title, $text, FALSE, LOG_TO_ROLLING);
e107::getAdminLog()->addEvent(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", $title, $text, FALSE, LOG_TO_ROLLING);
$logfp = fopen(e_LOG.'authlog.txt', 'a+'); fwrite($logfp, $title.': '.$text."\n"); fclose($logfp);
*/
@@ -476,7 +476,7 @@ class auth
$text = 'STD: '.$username.' ('.$extra_text.')';
$title = e107::getParser()->toDB($title);
$text = e107::getParser()->toDB($text);
e107::getAdminLog()->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", $title, $text, FALSE, LOG_TO_ROLLING);
e107::getAdminLog()->addEvent(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", $title, $text, FALSE, LOG_TO_ROLLING);
// $logfp = fopen(e_LOG.'authlog.txt', 'a+'); fwrite($logfp, $title.': '.$text."\n"); fclose($logfp);
*/

File diff suppressed because it is too large Load Diff

View File

@@ -135,7 +135,7 @@ function do_export($filename, $type_list='',$format_array=array(), $sep = ',', $
// Log event to admin log
function banlist_adminlog($msg_num='00', $woffle='')
{
e107::getAdminLog()->log_event('BANLIST_'.$msg_num, $woffle, E_LOG_INFORMATIVE, '');
e107::getAdminLog()->add('BANLIST_'.$msg_num, $woffle, E_LOG_INFORMATIVE, '');
}

View File

@@ -716,7 +716,7 @@ require_once(e_ADMIN.'footer.php');
*/
function frontpage_adminlog($msg_num = '00', $woffle = '')
{
e107::getAdminLog()->log_event('FRONTPG_'.$msg_num, $woffle, E_LOG_INFORMATIVE, '');
e107::getAdminLog()->add('FRONTPG_'.$msg_num, $woffle, E_LOG_INFORMATIVE, '');
}

View File

@@ -2918,7 +2918,7 @@ class media_admin_ui extends e_admin_ui
{
if(!$sc_path) return array();
$path = e107::getParser()->replaceConstants($sc_path);
$info = e107::getFile()->get_file_info($path,true);
$info = e107::getFile()->getFileInfo($path,true);
return array(
'media_type' => $info['mime'],
'media_datestamp' => time(),
@@ -3042,7 +3042,7 @@ class media_admin_ui extends e_admin_ui
{
$mes = e107::getMessage();
$tp = e107::getParser();
$f = e107::getFile()->get_file_info($oldpath,TRUE);
$f = e107::getFile()->getFileInfo($oldpath,TRUE);
$mes->addDebug("checkDupe(): newpath=".$newpath."<br />oldpath=".$oldpath."<br />".print_r($newpath,TRUE));
if(file_exists($newpath) || e107::getDb()->select("core_media","*","media_url = '".$tp->createConstants($newpath,'rel')."' LIMIT 1") )
@@ -3399,7 +3399,7 @@ class media_admin_ui extends e_admin_ui
}
// End Resize routine. ---------------------
$f = $fl->get_file_info($oldpath);
$f = $fl->getFileInfo($oldpath);
if(!$f['mime'])
{
@@ -3510,27 +3510,21 @@ class media_admin_ui extends e_admin_ui
$mes = e107::getMessage();
$tmp = array();
$tmp['image_post'] = intval($_POST['image_post']);
$tmp['resize_method'] = $tp->toDB($_POST['resize_method']);
$tmp['im_path'] = trim($tp->toDB($_POST['im_path']));
$tmp['image_post_class'] = intval($_POST['image_post_class']);
$tmp['image_post_disabled_method'] = intval($_POST['image_post_disabled_method']);
$tmp['enable_png_image_fix'] = intval($_POST['enable_png_image_fix']);
$tmp['image_post'] = (int) $_POST['image_post'];
$tmp['resize_method'] = $tp->toDB($_POST['resize_method']);
$tmp['im_path'] = trim($tp->toDB($_POST['im_path']));
$tmp['image_post_class'] = (int) $_POST['image_post_class'];
$tmp['image_post_disabled_method'] = (int) $_POST['image_post_disabled_method'];
$tmp['enable_png_image_fix'] = (int) $_POST['enable_png_image_fix'];
if($_POST['img_import_resize_w'] && $_POST['img_import_resize_h'])
{
$tmp['img_import_resize'] = intval($_POST['img_import_resize_w'])."x".intval($_POST['img_import_resize_h']);
}
if ($admin_log->logArrayDiffs($tmp, $pref, 'IMALAN_04'))
{
save_prefs(); // Only save if changes
$mes->add(IMALAN_9, E_MESSAGE_SUCCESS);
}
else
{
$mes->add(IMALAN_20, E_MESSAGE_INFO);
}
e107::getConfig()->setPref($tmp)->save(true,true,true);
}

View File

@@ -624,7 +624,7 @@ class mailout_main_ui extends e_admin_ui
else
{
$mes->addSuccess(LAN_MAILOUT_81. ' ('.$sendto.')');
e107::getAdminLog()->log_event('MAIL_01', $sendto, E_LOG_INFORMATIVE,'');
e107::getAdminLog()->add('MAIL_01', $sendto, E_LOG_INFORMATIVE,'');
}
@@ -750,7 +750,7 @@ class mailout_main_ui extends e_admin_ui
if ($this->mailAdmin->activateEmail($mailId, FALSE, $notify, $first, $last))
{
e107::getMessage()->addSuccess(LAN_MAILOUT_185);
$log->log_event('MAIL_06','ID: '.$mailId,E_LOG_INFORMATIVE,'');
$log->add('MAIL_06','ID: '.$mailId,E_LOG_INFORMATIVE,'');
}
else
{

View File

@@ -367,7 +367,7 @@ class plugin_ui extends e_admin_ui
// $name = deftrue($info['plugin_name'],$info['plugin_name']). " v".$info['plugin_version']. "({e_PLUGIN}".$info['plugin_path'].")";
// $log->log_event('PLUGMAN_01', $name, E_LOG_INFORMATIVE, '');
// $log->add('PLUGMAN_01', $name, E_LOG_INFORMATIVE, '');
// make sure ALL plugin/addon pref lists get update and are current
e107::getPlug()->clearCache()->buildAddonPrefLists();
@@ -2804,7 +2804,7 @@ class pluginManager{
$name = deftrue($info['plugin_name'],$info['plugin_name']). " v".$info['plugin_version']. "({e_PLUGIN}".$info['plugin_path'].")";
$log->log_event('PLUGMAN_01', $name, E_LOG_INFORMATIVE, '');
$log->add('PLUGMAN_01', $name, E_LOG_INFORMATIVE, '');
$this->show_message($text, E_MESSAGE_SUCCESS);
}

View File

@@ -291,7 +291,7 @@ function sendTest()
else
{
$mes->addSuccess(LAN_MAILOUT_81. ' ('.$sendto.')');
$log->log_event('MAIL_01',$sendto,E_LOG_INFORMATIVE,'');
$log->add('MAIL_01',$sendto,E_LOG_INFORMATIVE,'');
}
}

View File

@@ -1,925 +0,0 @@
<?php
/*
* 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)
*
*/
require_once("../class2.php");
if (!getperms("1"))
{
e107::redirect('admin');
exit;
}
e107::coreLan('theme', true);
$e_sub_cat = 'theme_manage';
e107::css("inline","
.block-text h2.caption { text-align: right; margin-bottom: -30px; padding-right: 10px; }
.hide { display: none }
");
require_once(e_HANDLER."theme_handler.php");
$themec = new themeHandler;
// print_a($_GET);
$mode = varset($_GET['mode'],'main'); // (e_QUERY) ? e_QUERY :"main" ;
if(!empty($_GET['action']))
{
define('e_IFRAME',true);
}
if(!empty($_GET['action']))
{
require_once("auth.php");
switch ($_GET['action'])
{
case 'login':
$mp = $themec->getMarketplace();
echo $mp->renderLoginForm();
exit;
break;
/*
case 'download':
$string = base64_decode($_GET['src']);
parse_str($string, $p);
$mp = $themec->getMarketplace();
$mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass);
// Server flush useless. It's ajax ready state 4, we can't flush (sadly) before that (at least not for all browsers)
echo "<pre>Connecting...\n"; flush();
// download and flush
$mp->download($p['id'], $p['mode'], $p['type']);
echo "</pre>"; flush();
exit;
break;
*/
case 'info':
if(!empty($_GET['src']))
{
$string = base64_decode($_GET['src']);
parse_str($string,$p);
$themeInfo = e107::getSession()->get('thememanager/online/'.intval($p['id']));
echo $themec->renderThemeInfo($themeInfo);
}
break;
case 'preview':
// Theme Info Ajax
$tm = (string) $_GET['id'];
$data = $themec->getThemeInfo($tm);
echo $themec->renderThemeInfo($data);
// exit;
break;
}
/*
if(vartrue($_GET['src'])) // Process Theme Download.
{
$string = base64_decode($_GET['src']);
parse_str($string,$p);
if(vartrue($_GET['info']))
{
echo $themec->renderThemeInfo($p);
// print_a($p);
exit;
}
$remotefile = $p['url'];
e107::getFile()->download($remotefile,'theme');
exit;
}
*/
// Theme Info Ajax
// FIXME addd action=preview to the url, remove this block
if(!empty($_GET['id']))
{
$tm = (string) $_GET['id'];
$data = $themec->getThemeInfo($tm);
echo $themec->renderThemeInfo($data);
}
require_once(e_ADMIN."footer.php");
exit;
}
else
{
require_once("auth.php");
/*
echo '
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
&nbsp;
</div>
<div class="modal-body">
<p>Loading…</p>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn btn-primary">Close</a>
</div>
</div>';
*/
}
if($mode == 'download' && !empty($_GET['src']))
{
define('e_IFRAME', true);
$frm = e107::getForm();
$mes = e107::getMessage();
$string = base64_decode($_GET['src']);
parse_str($string, $data);
if(!empty($data['price']))
{
e107::getRedirect()->go($data['url']);
return true;
}
if(deftrue('e_DEBUG_MARKETPLACE'))
{
echo "<b>DEBUG MODE ACTIVE (no downloading)</b><br />";
echo '$_GET: ';
print_a($_GET);
echo 'base64 decoded and parsed as $data:';
print_a($data);
return false;
}
$mp = $themec->getMarketplace();
$mes->addSuccess(TPVLAN_85);
if($mp->download($data['id'], $data['mode'], 'theme')) // download and unzip theme.
{
// Auto install?
// $text = e107::getPlugin()->install($data['plugin_folder']);
// $mes->addInfo($text);
echo $mes->render('default', 'success');
e107::getTheme()->clearCache();
}
else
{
echo $mes->addError('Unable to continue')->render('default', 'error');
}
echo $mes->render('default', 'debug');
}
elseif(!empty($_POST['selectadmin']))
{
$mode = "admin";
}
if(!empty($_POST['upload']))
{
$mode = "upload";
}
elseif(!empty($_POST['selectmain']) || isset($_POST['setUploadTheme']))
{
$mode = "main";
}
if($mode == 'convert')
{
new theme_builder;
}
else
{
$themec -> showThemes($mode);
}
// <a data-toggle="modal" href="'.e_SELF.'" data-target="#myModal" class="btn" >Launch demo modal</a>
require_once("footer.php");
function theme_adminmenu()
{
//global $mode;
$mode = varset($_GET['mode'],'main');
// $e107 = &e107::getInstance();
$var['main']['text'] = TPVLAN_33;
$var['main']['link'] = e_SELF;
$var['admin']['text'] = TPVLAN_34;
$var['admin']['link'] = e_SELF."?mode=admin";
$var['choose']['text'] = TPVLAN_51;
$var['choose']['link'] = e_SELF."?mode=choose";
$var['online']['text'] = TPVLAN_62;
$var['online']['link'] = e_SELF."?mode=online";
$var['upload']['text'] = TPVLAN_38;
$var['upload']['link'] = e_SELF."?mode=upload";
$var['convert']['text'] = ADLAN_CL_6;
$var['convert']['link'] = e_SELF."?mode=convert";
// $selected = (e_QUERY) ? e_QUERY : "main";
$icon = e107::getParser()->toIcon('e-themes-24');
$caption = $icon."<span>".TPVLAN_26."</span>";
e107::getNav()->admin($caption, $mode, $var);
}
class theme_builder
{
var $themeName = "";
var $remove = array();
function __construct()
{
$ns = e107::getRender();
$tp = e107::getParser();
e107::getMessage()->addDebug("Disable debug to save generated files. ");
$this->themeName = $tp->filter($_GET['newtheme'],'w');
if(!empty($_GET['src']))
{
$this->themeSrc = $tp->filter($_GET['src'],'w');
$this->copyTheme();
/* $src = $tp->filter($_GET['src'],'w');
$name = $tp->filter($_GET['f']);
$title = $tp->filter($_GET['t']);
$this->copyTheme($src,$name,$title);*/
}
if(vartrue($_GET['step']) == 3)
{
$this->step3();
return;
}
if(vartrue($_GET['step']) == 2)
{
$this->step2();
}
else
{
$ret = $this->step1();
$ret2 = $this->copyThemeForm();
$tabs = array(
0 => array('caption'=>$ret['caption'], 'text'=>$ret['text']),
1 => array('caption'=>$ret2['caption'], 'text'=>$ret2['text']),
);
$ns->tablerender(ADLAN_140.SEP.ADLAN_CL_6,e107::getForm()->tabs($tabs));
}
}
function step1()
{
$fl = e107::getFile();
$frm = e107::getForm();
$ns = e107::getRender();
$mes = e107::getMessage();
$plugFolders = $fl->get_dirs(e_THEME);
foreach($plugFolders as $dir)
{
if(file_exists(e_THEME.$dir."/theme.xml") || $dir == 'templates')
{
continue;
}
$newDir[$dir] = $dir;
}
$mes->addInfo(' '.TPVLAN_64.' <br />
'.TPVLAN_65.'
<ul>
<li> '.TPVLAN_66.'</li>
<li> '.TPVLAN_67.'</li>
</ul>
');
$text = $frm->open('createPlugin','get',e_SELF."?mode=convert");
$text .= "<table class='table adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tbody>
<tr>
<td> ".TPVLAN_68."</td>
<td>".$frm->select("newtheme",$newDir)."</td>
</tr>";
/*
$text .= "
<tr>
<td>Create Files</td>
<td>".$frm->checkbox('createFiles',1,1)."</td>
</tr>";
*/
$text .= "</tbody>
</table>
<div class='buttons-bar center'>
".$frm->admin_button('step', 2,'other',LAN_GO)."
</div>";
$text .= $frm->close();
return array('caption'=>TPVLAN_88, 'text'=>$mes->render() . $text);
$ns->tablerender(TPVLAN_26.SEP.TPVLAN_88.SEP. TPVLAN_CONV_1, $mes->render() . $text);
}
function step2()
{
$ns = e107::getRender();
$mes = e107::getMessage();
$frm = e107::getForm();
$data = array(
'main' => array('name','lang','version','date', 'compatibility'),
'author' => array('name','url'),
'summary' => array('summary'),
'description' => array('description'),
'keywords' => array('one','two'),
'category' => array('category'),
'livedemo' => array('livedemo'),
'copyright' => array('copyright'),
'stylesheets' => array('stylesheets')
// 'adminLinks' => array('url','description','icon','iconSmall','primary'),
// 'sitelinks' => array('url','description','icon','iconSmall')
);
$legacyFile = e_THEME.$this->themeName."/theme.php";
$newThemeXML = e_THEME.$this->themeName."/theme.xml";
if(file_exists($newThemeXML))
{
$info = e107::getTheme()->getThemeInfo($this->themeName);
e107::getDebug()->log($info);
if($this->themeSrc) // New theme copied from another
{
$defaults = array(
"main-name" => ucfirst($this->themeName),
'category-category' => vartrue($info['category']),
);
}
else
{
$defaults = array(
"main-name" => vartrue($info['name']),
"main-date" => vartrue($info['date']),
"main-version" => vartrue($info['version']),
"author-name" => vartrue($info['author']),
"author-url" => vartrue($info['website']),
"description-description" => vartrue($info['description']),
"summary-summary" => vartrue($info['summary']),
'category-category' => vartrue($info['category']),
// "custompages" => vartrue($leg['CUSTOMPAGES']),
);
}
if(!empty($info['keywords']['word']))
{
$defaults['keywords-one'] = $info['keywords']['word'][0];
$defaults['keywords-two'] = $info['keywords']['word'][1];
}
}
elseif(file_exists($legacyFile))
{
$legacyData = file_get_contents($legacyFile);
$regex = '/\$([\w]*)\s*=\s*("|\')([\w @.\/:<\>,\'\[\] !()]*)("|\');/im';
preg_match_all($regex, $legacyData, $matches);
$leg = array();
foreach($matches[1] as $i => $m)
{
$leg[$m] = strip_tags($matches[3][$i]);
if(substr($m,0,5) == 'theme' || $m == "CUSTOMPAGES")
{
$search[] = $matches[0][$i];
}
}
$defaults = array(
"main-name" => vartrue($leg['themename']),
"author-name" => vartrue($leg['themeauthor']),
"author-url" => vartrue($leg['themewebsite']),
"description-description" => '',
"summary-summary" => vartrue($leg['themeinfo']),
"custompages" => vartrue($leg['CUSTOMPAGES']),
);
$search[] = "Steve Dunstan";
$search[] = "jalist@e107.org";
$_SESSION['themebulder-remove'] = $search;
$mes->addInfo("Loading theme.php file");
}
$text = $frm->open('newtheme-step3','post', e_SELF.'?mode=convert&src='.$this->themeSrc.'&newtheme='.$this->themeName.'&step=3');
$text .= "<table class='table adminlist'>";
foreach($data as $key=>$val)
{
$text.= "<tr><td>$key</td><td>
<div class='controls'>";
foreach($val as $type)
{
$nm = $key.'-'.$type;
$name = "xml[$nm]";
$size = (count($val)==1) ? 'col-md-7' : 'col-md-2';
$text .= "<div class='{$size}'>".$this->xmlInput($name, $key."-". $type, vartrue($defaults[$nm]))."</div>";
}
$text .= "</div></td></tr>";
}
$text .= "</table>";
$text .= "
<div class='buttons-bar center'>"
.$frm->hidden('newtheme', $this->themeName);
$text .= $frm->hidden('xml[custompages]', trim(vartrue($leg['CUSTOMPAGES'])))
.$frm->admin_button('step', 3,'other',LAN_GENERATE)."
</div>";
$text .= $frm->close();
// return array('caption'=>TPVLAN_88.SEP. TPVLAN_CONV_2, 'text'=>$mes->render() . $text);
$ns->tablerender(TPVLAN_26.SEP.ADLAN_CL_6.SEP. TPVLAN_CONV_2, $mes->render() . $text);
}
function step3()
{
$ns = e107::getRender();
$mes = e107::getMessage();
// print_a($_POST);
if(!empty($_POST['xml']))
{
$xmlText = $this->createXml($_POST['xml']);
$ns->tablerender("theme.xml", $mes->render(). "<pre>".$xmlText."</pre>");
}
$legacyFile = e_THEME.$this->themeName."/theme.php";
if(file_exists($legacyFile) && empty($this->themeSrc))
{
$legacyData = file_get_contents($legacyFile);
$legacyData = e107::getTheme()->upgradeThemeCode($legacyData);
$output = nl2br(htmlentities($legacyData));
$ns->tablerender("theme.php (updated)", $output);
}
}
function createXml($data)
{
$ns = e107::getRender();
$mes = e107::getMessage();
$tp = e107::getParser();
foreach($data as $key=>$val)
{
$key = strtoupper(str_replace("-","_",$key));
$newArray[$key] = $val;
}
if(!empty($newArray['CUSTOMPAGES']))
{
$newArray['CUSTOMPAGES'] = trim($newArray['CUSTOMPAGES']);
$LAYOUTS = "\n<layout name='custom' title='Custom'>\n";
$LAYOUTS .= " <custompages>{CUSTOMPAGES}</custompages>\n";
$LAYOUTS .= " </layout>";
}
else
{
$LAYOUTS = "";
}
if(!empty($newArray['STYLESHEETS_STYLESHEETS']))
{
$STYLESHEETS = '';
foreach($newArray['STYLESHEETS_STYLESHEETS'] as $val)
{
if(empty($val['file']))
{
continue;
}
$STYLESHEETS .= "\t\t<css file=\"".$val['file']."\" name=\"".$val['name']."\" />\n";
}
if(!empty($STYLESHEETS))
{
$STYLESHEETS = "\n\t<stylesheets>\n".$STYLESHEETS."\t</stylesheets>";
}
unset($newArray['STYLESHEETS_STYLESHEETS']);
}
else
{
$STYLESHEETS = "";
}
$newArray['STYLESHEETS'] = $STYLESHEETS;
// print_a($newArray);
$template = <<<TEMPLATE
<?xml version="1.0" encoding="utf-8"?>
<e107Theme name="{MAIN_NAME}" lan="{MAIN_LANG}" version="{MAIN_VERSION}" date="{MAIN_DATE}" compatibility="{MAIN_COMPATIBILITY}" livedemo="{LIVEDEMO_LIVEDEMO}">
<author name="{AUTHOR_NAME}" url="{AUTHOR_URL}" />
<summary lan="">{SUMMARY_SUMMARY}</summary>
<description lan="">{DESCRIPTION_DESCRIPTION}</description>
<category>{CATEGORY_CATEGORY}</category>
<keywords>
<word>{KEYWORDS_ONE}</word>
<word>{KEYWORDS_TWO}</word>
</keywords>
<copyright>{COPYRIGHT_COPYRIGHT}</copyright>
<screenshots>
<image>preview.jpg</image>
<image>fullpreview.jpg</image>
</screenshots>{STYLESHEETS}
<layouts>
<layout name='default' title='Default' default='true' />{LAYOUTS}
</layouts>
</e107Theme>
TEMPLATE;
$template = str_replace("{LAYOUTS}",$LAYOUTS, $template);
$result = e107::getParser()->simpleParse($template, $newArray);
$path = e_THEME.$this->themeName."/theme.xml";
if(E107_DEBUG_LEVEL > 0)
{
$mes->addDebug("Debug Mode active - no file saved. ");
return htmlentities($result);
}
if(file_put_contents($path,$result))
{
$mes->addSuccess("Saved: ".$path);
}
else
{
$mes->addError("Couldn't Save: ".$path);
}
return htmlentities($result);
}
function xmlInput($name, $info, $default='')
{
$frm = e107::getForm();
list($cat,$type) = explode("-",$info);
$size = 30;
$help = '';
$sizex = '';
switch ($info)
{
case 'main-name':
$help = TPVLAN_CONV_3;
$required = true;
$pattern = "[A-Za-z 0-9]*";
break;
case 'main-lang':
$help = TPVLAN_CONV_4;
$required = false;
$placeholder= "LAN equivalent";
$pattern = "[A-Z0-9_]*";
break;
case 'main-date':
$help = TPVLAN_CONV_6;
$required = true;
$default = (empty($default)) ? time() : strtotime($default);
break;
case 'main-version':
$default = '1.0';
$required = true;
$help = TPVLAN_CONV_5;
$pattern = "^[\d]{1,2}\.[\d]{1,2}$";
break;
case 'main-compatibility':
$default = '2.0';
$required = true;
$help = TPVLAN_CONV_7;
$pattern = "^[\d]{1,2}\.[\d]{1,2}$";
break;
case 'author-name':
$default = (vartrue($default)) ? $default : USERNAME;
$required = true;
$help = TPVLAN_CONV_8;
$pattern = "[A-Za-z \.0-9]*";
break;
case 'author-url':
$required = true;
$help = TPVLAN_CONV_9;
// $pattern = "https?://.+";
break;
case 'livedemo-livedemo':
$required = false;
$help = TPVLAN_CONV_16;
$placeholder= "http://demo-of-my-theme.com";
// $pattern = "https?://.+";
break;
//case 'main-installRequired':
// return "Installation required: ".$frm->radio_switch($name,'',LAN_YES, LAN_NO);
//break;
case 'summary-summary':
$help = TPVLAN_CONV_10;
$required = true;
$size = 200;
$placeholder= " ";
$pattern = "[A-Za-z,() \.0-9]*";
break;
case 'keywords-one':
case 'keywords-two':
$help = TPVLAN_CONV_11;
$required = true;
$size = 20;
$placeholder= " ";
$pattern = '^[a-z]*$';
break;
case 'description-description':
$help = TPVLAN_CONV_12;
$required = true;
$size = 100;
$placeholder = " ";
$pattern = "[A-Za-z \.0-9]*";
break;
case 'category-category':
$help = TPVLAN_CONV_13;
$required = true;
$size = 20;
break;
default:
break;
}
$req = ($required == true) ? "&required=1" : "";
$placeholder = (varset($placeholder)) ? $placeholder : $type;
$pat = ($pattern) ? "&pattern=".$pattern : "";
$text = '';
switch ($type)
{
case 'stylesheets':
$fl = e107::getFile();
$fl->setMode('full');
$stylesheets = $fl->get_files(e_THEME.$this->themeName."/", "\.css", null, 1);
foreach($stylesheets as $key=>$path)
{
$file = str_replace(e_THEME.$this->themeName."/",'',$path);
$text .= "<div class='row-fluid'>";
$text .= "<div class='controls'>";
$text .= "<div class='col-md-3'>".$frm->checkbox($name.'['.$key.'][file]',$file, false, array('label'=>$file))."
<div class='field-help'>".TPVLAN_CONV_14."</div></div>";
$text .= "<div class='col-md-3'>".$frm->text($name.'['.$key.'][name]', $default, $size, 'placeholder='.$file . $req. $pat)."
<div class='field-help'>".TPVLAN_CONV_15."</div></div>";
// $text .= "<div class='span2'>".$frm->checkbox('css['.$key.'][file]',$file, false, array('label'=>$file))."</div>";
// $text .= "<div class='span2'>".$frm->text('css['.$key.'][name]', $default, $size, 'placeholder='.$placeholder . $req. $pat)."</div>";
$text .= "</div>";
$text .= "</div>";
}
return $text;
break;
case 'date':
$text = $frm->datepicker($name, $default, 'format=yyyy-mm-dd'.$req.'&size=block-level');
break;
case 'description':
$text = $frm->textarea($name,$default, 3, 100, $req.'&size=block-level'); // pattern not supported.
break;
case 'category':
$allowedCategories = array(
'generic', 'adult', 'blog', 'clan', 'children',
'corporate', 'forum', 'gaming', 'gallery', 'news',
'social', 'video', 'multimedia');
sort($allowedCategories);
$text = $frm->select($name, $allowedCategories,$default,'useValues=1&required=1', true);
break;
default:
$text = $frm->text($name, $default, $size, 'placeholder='.$placeholder . $req. $pat.'&size=block-level');
break;
}
$text .= ($help) ? "<span class='field-help'>".$help."</span>" : "";
return $text;
}
function copyThemeForm()
{
$frm = e107::getForm();
$list = e107::getTheme()->clearCache()->getThemeList(); // (e_THEME);
$folders = array_keys($list);
$text = $frm->open('copytheme','get','theme.php?mode=convert');
$text .= "<table class='table adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tr>
<td>".TPVLAN_91."</td>
<td>".$frm->select("src",$folders,'',array('useValues'=>1))."</td>
</tr>
<tr>
<td>".TPVLAN_92."</td>
<td>".$frm->text("newtheme",'',25, array('pattern'=>'[a-z_0-9]*', 'required'=>1))."</td>
</tr>
";
/*
$text .= "
<tr>
<td>Create Files</td>
<td>".$frm->checkbox('createFiles',1,1)."</td>
</tr>";
*/
$text .= "
</table>
<div class='buttons-bar center'>
".$frm->admin_button('step', 2,'success', LAN_CREATE)."
</div>";
$text .= $frm->close();
// $text = "Create a new theme based on ".e->select('copytheme',$list);
return array('caption'=>LAN_CREATE, 'text'=>$text);
}
private function copyTheme()
{
if(empty($this->themeSrc) || empty($this->themeName) || is_dir(e_THEME.$this->themeName))
{
return false;
}
if(e107::getFile()->copy(e_THEME.$this->themeSrc, e_THEME.$this->themeName))
{
$newfiles = scandir(e_THEME.$this->themeName);
foreach($newfiles as $file)
{
if(is_dir(e_THEME.$this->themeName.'/'.$file) || $file === '.' || $file === '..')
{
continue;
}
if(strpos($file,"admin_") === 0)
{
unlink(e_THEME.$this->themeName.'/'.$file);
}
}
}
}
}
?>

View File

@@ -507,476 +507,4 @@ exit;
$action = 'list'; // Default action
if (e_QUERY)
{
$tmp = explode('.', e_QUERY);
$action = $tmp[0];
$id = varset($tmp[1],0);
}
if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) )
{
$res = $sql ->select("upload", "*", "upload_id='".intval($id)."'");
$row = $sql ->fetch();
if (preg_match("#Binary (.*?)/#", $row['upload_file'], $match))
{
$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
}
else if ($row['upload_file'] && file_exists(e_UPLOAD.$row['upload_file']))
{
unlink(e_UPLOAD.$row['upload_file']);
}
if (preg_match("#Binary (.*?)/#", $row['upload_ss'], $match))
{
$sql ->delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
}
else if ($row['upload_ss'] && file_exists(e_FILE."public/".$row['upload_ss']))
{
unlink(e_UPLOAD.$row['upload_ss']);
}
$message = ($sql->db_Delete("upload", "upload_id='".intval($id)."'")) ? UPLLAN_1 : LAN_DELETED_FAILED;
e107::getLog()->add('UPLOAD_01',$row['upload_file'],E_LOG_INFORMATIVE,'');
}
if ($action == "dlm")
{
header("location: ".e_ADMIN."download.php?dlm.".$id);
exit;
}
if ($action == "news")
{
header("location: ".e_ADMIN."newspost.php?create.upload.".$id);
exit;
}
if ($action == "dl")
{
$id = str_replace("%20", " ", $id);
// if (preg_match("/Binary\s(.*?)\/.*/", $id, $result))
// {
// $bid = $result[1];
// $result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
// $binary_data = @mysql_result($result, 0, "binary_data");
// $binary_filetype = @mysql_result($result, 0, "binary_filetype");
// $binary_name = @mysql_result($result, 0, "binary_name");
// header("Content-type: ".$binary_filetype);
// header("Content-length: ".$download_filesize);
// header("Content-Disposition: attachment; filename=".$binary_name);
// header("Content-Description: PHP Generated Data");
// echo $binary_data;
// exit;
// }
// else
// {
// header("location:".e_UPLOAD.str_replace("dl.", "", e_QUERY));
// exit;
// }
}
require_once(e_HANDLER.'upload_handler.php');
require_once("auth.php");
require_once(e_HANDLER.'userclass_class.php');
$gen = new convert;
require_once(e_HANDLER.'form_handler.php');
$rs = new form;
// Need the userclass object for class selectors
if (!is_object($e_userclass)) { $e_userclass = new user_class; }
if (isset($_POST['optionsubmit']))
{
$temp = array();
$temp['upload_storagetype'] = $_POST['upload_storagetype'];
$temp['upload_maxfilesize'] = $_POST['upload_maxfilesize'];
$temp['upload_class'] = $_POST['upload_class'];
$temp['upload_enabled'] = (FILE_UPLOADS ? $_POST['upload_enabled'] : 0);
if ($temp['upload_enabled'] && !$sql->select("links", "*", "link_url='upload.php' "))
{
$sql->db_Insert("links", "0, '".LAN_UPLOAD."', 'upload.php', '', '', 1,0,0,0,0");
}
if (!$temp['upload_enabled'] && $sql->select("links", "*", "link_url='upload.php' "))
{
$sql->db_Delete("links", "link_url='upload.php' ");
}
if ($admin_log->logArrayDiffs($temp, $pref, 'UPLOAD_02'))
{
save_prefs(); // Only save if changes
$message = UPLLAN_2;
}
else
{
$message = UPLLAN_4;
}
}
if (isset($message))
{
require_once(e_HANDLER.'message_handler.php');
message_handler("ADMIN_MESSAGE", $message);
}
if (!FILE_UPLOADS)
{
message_handler("ADMIN_MESSAGE", UPLLAN_41);
}
switch ($action)
{
case 'filetypes' :
if(!getperms('0')) exit;
$definition_source = LAN_DEFAULT;
$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]))
{
// echo "Key: {$k} Class: {$c} Delete: {$_POST['file_line_delete'][$k]} List: {$_POST['file_type_list'][$k]} Size: {$_POST['file_maxupload'][$k]}<br />";
$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>\n";
if ((($handle = fopen(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES,'wt')) == FALSE)
|| (fwrite($handle,$file_text) == FALSE)
|| (fclose($handle) == FALSE))
{
$text = UPLLAN_61.e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES;
}
else
{
$text = '';
$text .= '<br />'.UPLLAN_59.e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES.'. '.UPLLAN_60.e_ADMIN.e_READ_FILETYPES.'<br />';
}
$ns->tablerender(LAN_FILETYPES, $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)))
{
$xml = e107::getXml();
$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');
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?filetypes'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<colgroup>
<col style='width:30%' />
<col style='width:40%' />
<col style='width:25%' />
<col style='width:5%' />
</colgroup>
<tr>
<td class='forumheader3' colspan='4'><input type='hidden' name='upload_do_edit' value='1'>".
str_replace(array('[x]', '[y]'),array(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES,e_ADMIN.e_READ_FILETYPES),UPLLAN_52)."</td>
</tr>
<tr>
<td class='forumheader3' colspan='4'>".UPLLAN_57.$source_file."</td>
</tr>
<tr>
<td class='fcaption'>".LAN_USERCLASS."</td>
<td class='fcaption'>".UPLLAN_54."</td>
<td class='fcaption' style='text-align:center'>".UPLLAN_55."</td>
<td class='fcaption' style='text-align:center'>".LAN_DELETE."</td>
</tr>";
foreach ($current_perms as $uclass => $uinfo)
{
$text .= "
<tr>
<td class='forumheader3'><select name='file_class_select[]' class='tbox'>
".$e_userclass->vetted_tree('file_class_select',array($e_userclass,'select'), $uclass,'member,main,classes,admin, no-excludes')."
</select></td>
<td class='forumheader3'><input type='text' name='file_type_list[]' value='{$uinfo['type']}' class='tbox' size='40' /></td>
<td class='forumheader3' style='text-align:center'><input type='text' name='file_maxupload[]' value='{$uinfo['maxupload']}' class='tbox' size='10' /></td>
<td class='forumheader3'><input type='checkbox' value='1' name='file_line_delete_{$uclass}' /></td>
</tr>";
}
// Now put up a box to add a new setting
$text .= "
<tr>
<td class='forumheader3'><select name='file_class_select[]' class='tbox'>
".$e_userclass->vetted_tree('file_class_select',array($e_userclass,'select'), '','member,main,classes,admin,blank, no-excludes')."
</select></td>
<td class='forumheader3'><input type='text' name='file_type_list[]' value='' class='tbox' size='40' /></td>
<td class='forumheader3' style='text-align:center'><input type='text' name='file_maxupload[]' value='".ini_get('upload_max_filesize')."' class='tbox' size='10' /></td>
<td class='forumheader3'>&nbsp;</td>
</tr>";
$text .= "
<tr>
<td class='forumheader3' style='text-align:center' colspan='4'>
<input class='btn btn-default btn-secondary button' type='submit' name='generate_filetypes_xml' value='".UPLLAN_56."' />
</td>
</tr>
</table></form>
</div>";
$ns->tablerender(LAN_FILETYPES, $text);
break;
case 'options' :
if(!getperms('0')) exit;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?options'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:50%' class='forumheader3'>".UPLLAN_25."<br />
<span class='smalltext'>".UPLLAN_26."</span></td>
<td style='width:50%' class='forumheader3'>". ($pref['upload_enabled'] == 1 ? $rs->form_radio("upload_enabled", 1, 1)." ".LAN_YES.$rs->form_radio("upload_enabled", 0)." ".LAN_NO : $rs->form_radio("upload_enabled", 1)." ".LAN_YES.$rs->form_radio("upload_enabled", 0, 1)." ".LAN_NO)."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".UPLLAN_33."<br />
<span class='smalltext'>".UPLLAN_34." (upload_max_filesize = ".ini_get('upload_max_filesize').", post_max_size = ".ini_get('post_max_size')." )</span></td>
<td style='width:30%' class='forumheader3'>". $rs->form_text("upload_maxfilesize", 10, $pref['upload_maxfilesize'], 10)."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".UPLLAN_37."<br />
<span class='smalltext'>".UPLLAN_38."</span></td>
<td style='width:30%' class='forumheader3'>".r_userclass("upload_class", $pref['upload_class'],"off","nobody,public,guest,member,admin,classes")."
</td>
</tr>
<tr>
<td colspan='2' class='forumheader' style='text-align:center'>". $rs->form_button("submit", "optionsubmit", LAN_SUBMIT)."
</td>
</tr>
</table>". $rs->form_close()."
</div>";
$ns->tablerender(LAN_OPTIONS, $text);
break;
case 'view' :
$sql->select('upload', '*', "upload_id='{$id}'");
$row = $sql->fetch();
extract($row);
$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
$poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
$upload_datestamp = $gen->convert_date($upload_datestamp, "long");
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<colgroup>
<col style='width:30%' />
<col style='width:70%' />
</colgroup>
<tr>
<td class='forumheader3'>".LAN_ID."</td>
<td class='forumheader3'>{$upload_id}</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_DATE."</td>
<td class='forumheader3'>{$upload_datestamp}</td>
</tr>
<tr>
<td class='forumheader3'>".UPLLAN_5."</td>
<td class='forumheader3'>{$poster}</td>
</tr>
<tr>
<td class='forumheader3'>".UPLLAN_6."</td>
<td class='forumheader3'><a href='mailto:{$upload_email}'>{$upload_email}</td>
</tr>
<tr>
<td class='forumheader3'>".UPLLAN_7."</td>
<td class='forumheader3'>".($upload_website ? "<a href='{$upload_website}'>{$upload_website}</a>" : " - ")."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_FILE_NAME."</td>
<td class='forumheader3'>".($upload_name ? $upload_name: " - ")."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_VERSION."</td>
<td class='forumheader3'>".($upload_version ? $upload_version : " - ")."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_FILE."</td>
<td class='forumheader3'>".(is_numeric($upload_file) ? "Binary file ID ".$upload_file : "<a href='".e_SELF."?dl.{$upload_file}'>$upload_file</a>")."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_SIZE."</td>
<td class='forumheader3'>".$e107->parseMemorySize($upload_filesize)."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_SCREENSHOT."</td>
<td class='forumheader3'>".($upload_ss ? "<a href='".e_BASE."request.php?upload.".$upload_id."'>".$upload_ss."</a>" : " - ")."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_DESCRIPTION."</td>
<td class='forumheader3'>{$upload_description}</td>
</tr>
<tr>
<td class='forumheader3'>".UPLLAN_14."</td>
<td class='forumheader3'>".($upload_demo ? $upload_demo : " - ")."</td>
</tr>
<tr>
<td class='forumheader3'>".LAN_OPTIONS."</td>
<td class='forumheader3'><a href='".e_SELF."?dlm.{$upload_id}'>".UPLAN_COPYTODLM."</a> | <a href='".e_SELF."?news.{$upload_id}'>".UPLLAN_16."</a> | <a href='".e_SELF."?dis.{$upload_id}'>".UPLLAN_17."</a></td>
</tr>
</table>
</div>";
$ns->tablerender(UPLLAN_18, $text);
// Intentionally fall through into list mode
case 'list' :
default :
$imgd = e_BASE.$IMAGES_DIRECTORY;
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<colgroup>
<col style='width:5%' />
<col style='width:20%' />
<col style='width:15%' />
<col style='width:20%' />
<col style='width:25%' />
<col style='width:10%' />
<col style='width:50px;white-space:nowrap' />
</colgroup>
<tr>
<td class='fcaption'>".LAN_ID."</td>
<td class='fcaption'>".LAN_DATE."</td>
<td class='fcaption'>".UPLLAN_5."</td>
<td class='fcaption'>".LAN_NAME."</td>
<td class='fcaption'>".LAN_FILE_NAME."</td>
<td class='fcaption'>".LAN_SIZE."</td>
<td class='fcaption'>".LAN_ACTIONS."</td>
</tr>";
$text .= "<tr><td class='forumheader3' style='text-align:center' colspan='6'>";
if (!$active_uploads = $sql->select("upload", "*", "upload_active=0 ORDER BY upload_id ASC"))
{
$text .= UPLLAN_19.".\n</td>\n</tr>";
}
else
{
$activeUploads = $sql -> db_getList();
$text .= UPLLAN_20." ".($active_uploads == 1 ? UPLAN_IS : UPLAN_ARE).$active_uploads." ".($active_uploads == 1 ? UPLLAN_21 : UPLLAN_27)." ...";
$text .= "</td></tr>";
foreach($activeUploads as $row)
{
extract($row);
$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
$poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
$upload_datestamp = $gen->convert_date($upload_datestamp, "short");
$text .= "<tr>
<td class='forumheader3'>".$upload_id ."</td>
<td class='forumheader3'>".$upload_datestamp."</td>
<td class='forumheader3'>".$poster."</td>
<td class='forumheader3'><a href='".e_SELF."?view.".$upload_id."'>".$upload_name ."</a></td>
<td class='forumheader3'>".$upload_file ."</td>
<td class='forumheader3'>".$e107->parseMemorySize($upload_filesize)."</td>
<td class='forumheader3'>
<form action='".e_SELF."?dis.{$upload_id}' id='uploadform_{$upload_id}' method='post'>
<div><a href='".e_SELF."?dlm.{$upload_id}'><img src='".e_IMAGE."admin_images/downloads_16.png' alt='".UPLAN_COPYTODLS."' title='".UPLAN_COPYTODLS."' style='border:0' /></a>
<a href='".e_SELF."?news.{$upload_id}'><img src='".e_IMAGE."admin_images/news_16.png' alt='".UPLLAN_16."' title='".UPLLAN_16."' style='border:0' /></a>
<input type='image' title='".LAN_DELETE."' name='updelete[upload_{$upload_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(UPLLAN_45." [ {$upload_name} ]")."') \"/>
</div></form></td>
</tr>";
}
}
$text .= "</table>\n</div>";
$ns->tablerender(LAN_UPLOADS, $text);
} // end - switch($action)
function upload_adminmenu()
{
$action = (e_QUERY) ? e_QUERY : "list";
$var['list']['text'] = UPLLAN_51;
$var['list']['link'] = e_SELF."?list";
$var['list']['perm'] = "V";
if(getperms("0"))
{
$var['filetypes']['text'] = LAN_FILETYPES;
$var['filetypes']['link'] = e_SELF."?filetypes";
$var['filetypes']['perm'] = "0";
$var['options']['text'] = LAN_OPTIONS;
$var['options']['link'] = e_SELF."?options";
$var['options']['perm'] = "0";
}
show_admin_menu(LAN_UPLOADS, $action, $var);
}
require_once("footer.php");

View File

@@ -613,7 +613,7 @@ class users_admin_ui extends e_admin_ui
$vars = array('x'=>$sysuser->getId(), 'y'=> $sysuser->getName(), 'z'=> $sysuser->getValue('email'));
e107::getAdminLog()->log_event('USET_06', $tp->lanVars( USRLAN_162, $vars), E_LOG_INFORMATIVE);
e107::getAdminLog()->add('USET_06', $tp->lanVars( USRLAN_162, $vars), E_LOG_INFORMATIVE);
e107::getMessage()->addSuccess("(".$sysuser->getId().".".$sysuser->getName()." - ".$sysuser->getValue('email').") ".USRLAN_9);
// List data reload
@@ -786,7 +786,7 @@ class users_admin_ui extends e_admin_ui
// TODO - lan
$lan = 'Administrator --ADMIN_EMAIL-- (#--ADMIN_UID--, --ADMIN_NAME--) has logged in as the user --EMAIL-- (#--UID--, --NAME--)';
e107::getLog()->log_event('USET_100', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE);
e107::getLog()->add('USET_100', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE);
$eventData = array('user_id' => $sysuser->getId(), 'admin_id' => $user->getId());
e107::getEvent()->trigger('loginas', $eventData); // BC
@@ -814,7 +814,7 @@ class users_admin_ui extends e_admin_ui
// TODO - lan
$lan = 'Administrator --ADMIN_EMAIL-- (#--ADMIN_UID--, --ADMIN_NAME--) has logged out as the user --EMAIL-- (#--UID--, --NAME--)';
e107::getAdminLog()->log_event('USET_101', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE);
e107::getAdminLog()->add('USET_101', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE);
$eventData = array('user_id' => $sysuser->getId(), 'admin_id' => $user->getId());
e107::getEvent()->trigger('logoutas', $eventData); //BC
@@ -855,7 +855,7 @@ class users_admin_ui extends e_admin_ui
'z' => $user->getValue('email')
);
e107::getAdminLog()->log_event('USET_08', $tp->lanVars(USRLAN_244,$vars), E_LOG_INFORMATIVE);
e107::getAdminLog()->add('USET_08', $tp->lanVars(USRLAN_244,$vars), E_LOG_INFORMATIVE);
$this->redirect('list', 'main', true);
}
@@ -869,7 +869,7 @@ class users_admin_ui extends e_admin_ui
{
$vars = array('x'=>$sysuser->getId(), 'y'=>$sysuser->getName(), 'z'=>$sysuser->getValue('email'));
e107::getAdminLog()->log_event('USET_09',$tp->lanVars(USRLAN_165, $vars), E_LOG_INFORMATIVE);
e107::getAdminLog()->add('USET_09',$tp->lanVars(USRLAN_165, $vars), E_LOG_INFORMATIVE);
$mes->addSuccess($sysuser->getName()." (".$sysuser->getValue('email').") ".USRLAN_6);
$this->getTreeModel()->loadBatch(true);
}
@@ -1057,7 +1057,7 @@ class users_admin_ui extends e_admin_ui
if ($messaccess == '') $messaccess = UCSLAN_12."\n";
$message = USRLAN_256." ".$sysuser->getName().",\n\n".UCSLAN_4." ".SITENAME."\n( ".SITEURL." )\n\n".UCSLAN_5.": \n\n".$messaccess."\n".UCSLAN_10."\n".SITEADMIN;
// $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","User class change",str_replace("\n","<br />",$message),FALSE,LOG_TO_ROLLING);
// $admin_log->addEvent(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","User class change",str_replace("\n","<br />",$message),FALSE,LOG_TO_ROLLING);
$options['mail_subject'] = UCSLAN_2;
$options['mail_body'] = nl2br($message);
@@ -2639,10 +2639,7 @@ class users_admin_form_ui extends e_admin_form_ui
if($controller->getMode() != 'main' || $controller->getAction() != 'list') return;
$row = $controller->getListModel()->getData();
if(!getperms('4'))
{
// return;
}
// extract($row);
@@ -2749,14 +2746,14 @@ class users_admin_form_ui extends e_admin_form_ui
$opts['usersettings'] = LAN_EDIT;
}
if ($row['user_perms'] == "0" && !getperms("0"))
{
// if ($row['user_perms'] == "0" && !getperms("0"))
// {
// $text .= "";
}
elseif ($user_id != USERID || getperms("0"))
{
// }
// elseif ($user_id != USERID || getperms("0"))
// {
// $text .= "<option value='userclass'>".USRLAN_36."</option>\n"; // DEPRECATED. inline & batch should be enough.
}
// }
if ($row['user_perms'] != "0")
{
// $text .= "<option value='deluser'>".LAN_DELETE."</option>\n";