Skip to content

Commit

Permalink
Merge branch 'e107inc:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rica-carv authored Jul 5, 2024
2 parents bcaad61 + 7871b9d commit 591bab9
Show file tree
Hide file tree
Showing 60 changed files with 881 additions and 93 deletions.
4 changes: 2 additions & 2 deletions e107_admin/admin_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class admin_log_ui extends e_admin_ui
'dblog_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'dblog_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => '12%', 'filter' => true, 'help' => '', 'readParms' => array('mask'=>'dd MM yyyy hh:ii:ss'), 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
// 'dblog_microtime' => array ( 'title' => 'Microtime', 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'dblog_type' => array ( 'title' => RL_LAN_032, 'type' => 'method', 'data' => 'int', 'width' => '5%', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'dblog_type' => array ( 'title' => RL_LAN_032, 'type' => 'method', 'data' => 'int', 'width' => '5%', 'filter' => true, 'batch'=>true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'dblog_ip' => array ( 'title' => LAN_IP, 'type' => 'ip', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),

'dblog_user_id' => array ( 'title' => LAN_USER, 'type' => 'user', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms'=>'link=1', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
Expand Down Expand Up @@ -683,7 +683,7 @@ function dblog_remarks($curVal,$mode)
{
$id = $this->getController()->getListModel()->get('dblog_id');
$ret ="<a class='e-expandit' href='#rem-".$id."'>".RL_LAN_087."</a>";
$ret .= "<div style='display:none' id='rem-".$id."'>";
$ret .= "<div style='display:none;width:33vw' id='rem-".$id."'>";
$text = str_replace("<br />","\n",$text);
$text = str_replace("&#092;","/",$text);

Expand Down
8 changes: 4 additions & 4 deletions e107_admin/cpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,14 @@ class page_admin_ui extends e_admin_ui


// Menu Tab XXX 'menu_name' is 'menu_name' - not caption.
'menu_name' => array('title'=> CUSLAN_64, 'tab' => 2, 'type' => 'text', 'inline'=>false, 'width' => 'auto','nolist'=>false, "help"=>"Will be listed in the Menu-Manager under this name or may be called using {CMENU=name} in your theme. Must use ASCII characters only and be all lowercase."),
'menu_title' => array('title'=> CUSLAN_65, 'nolist'=>true, 'tab' => 2, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Caption displayed on the menu item.", 'writeParms'=>'size=xxlarge'),
'menu_name' => array('title'=> CUSLAN_64, 'tab' => 2, 'type' => 'text', 'inline'=>false, 'width' => 'auto','nolist'=>false, "help"=> CUSLAN_83),
'menu_title' => array('title'=> CUSLAN_65, 'nolist'=>true, 'tab' => 2, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>CUSLAN_84, 'writeParms'=>'size=xxlarge'),
'menu_text' => array('title'=> CUSLAN_66, 'nolist'=>true, 'tab' => 2, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page^' ),
'menu_template' => array('title'=> CUSLAN_67, 'nolist'=>true, 'tab' => 2, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),
'menu_class' => array('title'=> LAN_VISIBILITY, 'tab' => 3, 'type' => 'userclass', 'data'=>'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true),
'menu_button_text' => array('title'=> CUSLAN_68, 'nolist'=>true, 'tab' => 3, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Leave blank to use the default"),
'menu_button_text' => array('title'=> CUSLAN_68, 'nolist'=>true, 'tab' => 3, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>CUSLAN_85),

'menu_button_url' => array('title'=> CUSLAN_69, 'nolist'=>true, 'tab' => 3, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Leave blank to use the corresponding page", 'writeParms'=>'size=xxlarge'),
'menu_button_url' => array('title'=> CUSLAN_69, 'nolist'=>true, 'tab' => 3, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>CUSLAN_86, 'writeParms'=>'size=xxlarge'),

'menu_icon' => array('title' =>CUSLAN_70, 'nolist'=>true, 'tab' => 2, 'type' => 'icon', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','writeParms'=>'media=page^&glyphs=1', 'readonly'=>false),

Expand Down
5 changes: 4 additions & 1 deletion e107_admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,11 @@ public function ListUnbanTrigger($userid)
}

$row = e107::user($userid);

$sysuser->set('user_ban', 2)
->set('user_sess', e_user_model::randomKey())
->save();

$sql->update("user", "user_ban='0' WHERE user_id='".$userid."' ");
$sql->delete("banlist"," banlist_ip='{$row['user_ip']}' ");

$vars = array('x'=>$sysuser->getId(), 'y'=> $sysuser->getName(), 'z'=> $sysuser->getValue('email'));
Expand Down
2 changes: 1 addition & 1 deletion e107_handlers/admin_log_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function log_event($event_title, $event_detail, $event_type = E_LOG_INFOR
* Save all logs in the queue to the database and render any unhidden messages with the message handler.
* @see alias flushMessages() method below.
* @param string $logTitle - title for log entry eg. 'PREF_01'
* @param int $logImportance [optional] default E_LOG_INFORMATIVE - passed directly to admin log
* @param int $logImportance [optional] default E_LOG_INFORMATIVE, E_LOG_NOTICE, E_LOG_WARNING, E_LOG_FATAL - passed directly to admin log
* @param string $logEventCode [optional] - passed directly to admin log
* @param string $mstack [optional] message stack passed to message handler
* @param int LOG_TO_ADMIN|LOG_TO_ROLLING|LOG_TO_AUDIT
Expand Down
2 changes: 1 addition & 1 deletion e107_handlers/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -5310,7 +5310,7 @@ public static function scDualParams($parmstr, $first2array = false)
*/
public static function removeTrackers($get = array())
{
$trackers = array('fbclid','utm_source','utm_medium','utm_content','utm_campaign','elan', 'msclkid', 'gclid', 'gad', 'gad_source');
$trackers = array('fbclid','utm_source','utm_medium','utm_content','utm_campaign','elan', 'msclkid', 'gclid', 'gad', 'gad_source', 'mcp_token');

foreach($trackers as $val)
{
Expand Down
2 changes: 2 additions & 0 deletions e107_handlers/e_thumbnail_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ private function parseRequest()
$e_QUERY = base64_decode($_GET['id']);
}

$e_QUERY= str_replace('e_AVATAR', 'e_AVATAR/', $e_QUERY); // FIXME Quick and dirty fix.

parse_str(str_replace('&amp;', '&', $e_QUERY), $this->_request);

if(isset($this->_request['w']))
Expand Down
25 changes: 20 additions & 5 deletions e107_handlers/form_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1763,16 +1763,30 @@ public function datepicker($name, $datestamp = false, $options = null)
$xsize = (!empty($options['size']) && !is_numeric($options['size'])) ? $options['size'] : 'xlarge';
$disabled = !empty($options['disabled']) ? 'disabled' : '';
$placeholder = !empty($options['placeholder']) ? 'placeholder="'.$options['placeholder'].'"' : '';
$timezone = '';

$extras = '';


if(!empty($options['timezone'])) // since datetimepicker does not support timezones and assumes the browser timezone is the intended timezone.
{
date_default_timezone_set($options['timezone']);
$targetOffset = date('Z');
date_default_timezone_set(USERTIMEZONE);
$timezone = "data-date-timezone-offset='".$targetOffset."'";
$extras .= " data-date-timezone-offset='".$targetOffset."'";
}

if(!empty($options['minuteStep']))
{
$extras .= " data-minute-step='".(int) $options['minuteStep']."'";
}

if(!empty($options['startDate']))
{
$extras .= " data-start-date='". $options['startDate']."'";
}

if(!empty($options['showMeridian']))
{
$extras .= " data-show-meridian='". $options['showMeridian']."'";
}

$text = '';
Expand All @@ -1784,7 +1798,7 @@ public function datepicker($name, $datestamp = false, $options = null)
}
else
{
$text .= "<input class='{$class} input-".$xsize." form-control' type='text' size='{$size}' id='e-datepicker-{$id}' value='{$value}' data-date-unix ='{$useUnix}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} {$disabled} {$placeholder} {$timezone} />";
$text .= "<input class='{$class} input-".$xsize." form-control' type='text' size='{$size}' id='e-datepicker-{$id}' value='{$value}' data-date-unix ='{$useUnix}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} {$disabled} {$placeholder} {$extras} />";
$ftype = (!empty($options['debug'])) ? 'text' : 'hidden';
$text .= "<input type='{$ftype}' name='{$name}' id='{$id}' value='{$hiddenValue}' />";
}
Expand Down Expand Up @@ -3575,7 +3589,8 @@ public function _uc_select_cb($treename, $classnum, $current_value, $nest_level)
*/
public function optgroup_open($label, $disabled = false, $options = null)
{
return "<optgroup class='optgroup ".varset($options['class'])."' label='{$label}'".($disabled ? " disabled='disabled'" : '').">\n";
$unique = 'optgroup-'.$this->name2id($label);
return "<optgroup class='optgroup $unique ".varset($options['class'])."' label='{$label}'".($disabled ? " disabled='disabled'" : '').">\n";
}

/**
Expand Down
2 changes: 0 additions & 2 deletions e107_handlers/js_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1253,10 +1253,8 @@ public function renderJs($mod, $zone = null, $external = true, $return = false)
$tp = e107::getParser();
$json = $tp->toJSON($this->_e_js_settings);
echo "<script>\n";
echo '$(document).ready(function() {';
echo "var e107 = e107 || {'settings': {}, 'behaviors': {}};\n";
echo "jQuery.extend(e107.settings, " . $json . ");\n";
echo '});';
echo "</script>\n";
}
break;
Expand Down
8 changes: 4 additions & 4 deletions e107_languages/English/admin/lan_cpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
define("CUSLAN_80", "Sub Title");
define("CUSLAN_81", "Meta image");
define("CUSLAN_82", "Optional. Used by social media when sharing this page.");




define("CUSLAN_83", "Will be listed in the Menu-Manager under this name or may be called using {CMENU=name} in your theme. Must use ASCII characters only and be all lowercase.");
define("CUSLAN_84", "Caption displayed on the menu item.");
define("CUSLAN_85", "Leave blank to use the default");
define("CUSLAN_86", "Leave blank to use the corresponding page");
14 changes: 10 additions & 4 deletions e107_tests/tests/unit/e_fileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,19 @@ public function testZip()
$contents = self::readZipFile($destinationPath);
self::assertSame($expected, $contents);


// Test directory path.
$destinationPath = e_TEMP."testZip2.zip";

$data = array();
$data[] = e_TEMP;
$result = $this->fl->zip($data , $destinationPath, ['remove_path'=>e_IMAGE]);
$contents = self::readZipFile($destinationPath);
self::assertNotEmpty($contents);

}

/*
public function testZip()
{
}
public function testSetDefaults()
{
Expand Down
Loading

0 comments on commit 591bab9

Please sign in to comment.