fixed warning and deprecated errors

Dieser Commit ist enthalten in:
o.pinke 2022-04-03 15:17:52 +02:00
Ursprung f0aaecbded
Commit 885eec3df0
17 geänderte Dateien mit 293 neuen und 305 gelöschten Zeilen

Datei anzeigen

@ -525,7 +525,8 @@ abstract class cHTML5Common implements ArrayAccess
* @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
*/
public function offsetExists(mixed $offset): bool
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->attributes[strtolower($offset)]);
}

Datei anzeigen

@ -174,10 +174,10 @@ class UI_Menu {
foreach ($this->link as $key => $value) {
if ($value != NULL) {
if ($this->imagewidth[$key] != 0) {
if (!empty($this->imagewidth[$key]) && !empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">');
$img = $value->render();
} else {
} else if(!empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '">');
$img = $value->render();
}
@ -186,14 +186,12 @@ class UI_Menu {
} else {
$link = $this->title[$key];
if ($this->image[$key] != "") {
if (!empty($this->image[$key])) {
if ($this->imagewidth[$key] != 0) {
$img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">';
} else {
$img = '<img border="0" src="' . $this->image[$key] . '">';
}
} else {
$img = "&nbsp;";
}
}
@ -212,21 +210,24 @@ class UI_Menu {
$bgColor = $cfg["color"]["table_light_active"];
}
if ($this->extra[$key] == 'id="marked" ') {
if (!empty($this->extra[$key]) && $this->extra[$key] == 'id="marked" ') {
$bgColor = $cfg["color"]["table_light_active"];
}
}
$tpl->set('d', 'NAME', $link);
if ($this->image[$key] == "") {
if (empty($this->image[$key])) {
$tpl->set('d', 'ICON', '');
} else {
$tpl->set('d', 'ICON', $img);
}
if ($this->extra[$key] != "" || $this->rowmark == true) {
if (!empty($this->extra[$key]) || $this->rowmark == true) {
$extraadd = "";
if(empty($this->extra[$key])) {
$this->extra[$key] = '';
}
if ($this->rowmark == true) {
$extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"';
@ -439,7 +440,7 @@ class UI_Table_Form {
if (is_array($this->items)) {
foreach ($this->items as $key => $value) {
if ($this->itemType[$key] == 'subheader') {
if (isset($this->itemType[$key]) && $this->itemType[$key] == 'subheader') {
$subheader = '<tr class="text_medium" style="background-color: ' . $cfg["color"]["table_header"] . ';">';
$subheader .= '<td colspan="2" valign="top" style="border: 0px;border-top: 0px; border-bottom:0px; border-right:1px;border-color: ' . $cfg["color"]["table_border"] . '; border-style: solid;">' . $this->captions[$key] . '</td></tr>';
@ -703,6 +704,7 @@ class UI_Page {
class Link {
var $alt = '';
var $link;
var $title;
var $targetarea;
@ -770,7 +772,8 @@ class Link {
function render() {
global $sess, $cfg;
$custom = '';
$attributes = '';
if ($this->alt != "") {
$alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" ';
} else {
@ -819,7 +822,7 @@ class Link {
break;
}
if ($this->images == '') {
if (empty($this->images)) {
return ($link . $this->content . "</a>");
} else {
list($this->img_width, $this->img_height, $this->img_type, $this->img_attr) = getimagesize($cfg['path']['contenido'] . $this->images);
@ -910,6 +913,7 @@ class UI_List {
$colcount = 0;
if (is_array($this->cells)) {
$dark = true;
foreach ($this->cells as $row => $cells) {
$thefont = '';
$unne = '';
@ -928,7 +932,7 @@ class UI_List {
$bgColor = $cfg["color"]["table_light"];
}
if ($this->bgcolor[$row] != "") {
if (!empty($this->bgcolor[$row])) {
$bgColor = $this->bgcolor[$row];
}
@ -936,7 +940,7 @@ class UI_List {
$count = 0;
foreach ($cells as $key => $value) {
$thefontDispl = $thefont . $this->extra[$row][$key];
$thefontDispl = $thefont . (empty($this->extra[$row][$key]))?'':$this->extra[$row][$key];
$count++;
$tpl2->reset();
@ -966,7 +970,7 @@ class UI_List {
$tpl2->set('s', 'ALIGN', 'left');
}
if ($this->cellvalignment[$row][$key] != "") {
if (!empty($this->cellvalignment[$row][$key])) {
$tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]);
} else {
$tpl2->set('s', 'VALIGN', 'top');

Datei anzeigen

@ -377,6 +377,10 @@ class User {
*/
function getUserProperty($type, $name, $group = false) {
global $cfg, $perm;
if(empty($this->values)) {
return false;
}
if (!is_object($perm)) {
$perm = new Contenido_Perm();

Datei anzeigen

@ -58,7 +58,7 @@ class cRegistry {
public static function getFrontendPath() {
$cfgClient = self::getClientConfig();
$client = self::getClientId();
return $cfgClient[$client]['path']['frontend'];
return (empty($cfgClient))?'':$cfgClient[$client]['path']['frontend'];
}
/**

Datei anzeigen

@ -69,7 +69,7 @@ class cApiLayout extends Item {
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false) {
global $cfg;
$cfg = cRegistry::getConfig();
parent::__construct($cfg["tab"]["lay"], "idlay");
$this->setFilters(array(), array());
@ -78,7 +78,7 @@ class cApiLayout extends Item {
$this->_setLayPath();
}
$oClient = new cApiClient($client);
$oClient = new cApiClient(cRegistry::getClientId());
$aClientProp = $oClient->getPropertiesByType('layfileedit');
if(count($aClientProp) > 0) {
$this->_aLayFileEditConf = array_merge($this->_aLayFileEditConf, $aClientProp);

Datei anzeigen

@ -912,7 +912,7 @@ class cApiModule extends Item {
}
private function _displayNoteFromFile($bIsOldPath = FALSE) {
if ($this->_bNoted === true) {
if (isset($this->_bNoted) && $this->_bNoted === true) {
return;
}
global $frame, $area;

Datei anzeigen

@ -264,20 +264,19 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$template = $db->f("template");
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
$varstring = array();
if (!empty($a_c[$value])) {
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
foreach ($tmp1 as $key1 => $value1) {
foreach ($tmp1 as $key1 => $value1) {
$tmp2 = explode("=", $value1);
foreach ($tmp2 as $key2 => $value2) {
$varstring["$tmp2[0]"] = $tmp2[1];
$tmp2 = explode("=", $value1);
foreach ($tmp2 as $key2 => $value2) {
$varstring["$tmp2[0]"] = $tmp2[1];
}
}
}
$CiCMS_Var = '$C' . $value . 'CMS_VALUE';
$CiCMS_VALUE = '';
@ -305,7 +304,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$output = '<?php $modstart' . $value . ' = getmicrotime(); ?' . '>' . $output . '<?php $modend' . $value . ' = getmicrotime()+0.001; $modtime' . $value . ' = $modend' . $value . ' - $modstart' . $value . '; ?' . '>';
}
if ($fedebug != "") {
if (!empty($fedebug)) {
$output = addslashes('<?php echo \'<img onclick="javascript:showmod' . $value . '();" src="' . $cfg['path']['contenido_fullhtml'] . 'images/but_preview.gif">\'; ?' . '>' . "<br>") . $output;
$output = $output . addslashes('<?php echo \'<script language="javascript">function showmod' . $value . ' () { window.alert(\\\'\'. "' . addslashes($fedebug) . '".\'\\\');} </script>\'; ?' . '>');
}
@ -471,7 +470,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
}
//add system meta tag if there is no user meta tag
if ($bExists == false && strlen($aAutValue['content']) > 0) {
if ($bExists == false && isset($aAutValue['content']) && strlen($aAutValue['content']) > 0) {
array_push($metatags, $aAutValue);
}
}
@ -481,7 +480,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
foreach ($metatags as $value) {
if (getEffectiveSetting('generator', 'html5', "false") == "true") {
if ($value['name'] == 'date')
if (isset($value['name']) && $value['name'] == 'date')
continue;
}
if (!empty($value['content'])) {
@ -497,7 +496,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$oMetaTagGen->removeAttribute("id");
/* Check if metatag already exists */
if (preg_match('/(<meta(?:\s+)name(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)' . $value["name"] . '(?:\s*)(?:\\\\"|\\\\\')(?:[^>]+)>\r?\n?)/i', $code, $aTmetatagfound)) {
if (isset($value["name"]) && preg_match('/(<meta(?:\s+)name(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)' . $value["name"] . '(?:\s*)(?:\\\\"|\\\\\')(?:[^>]+)>\r?\n?)/i', $code, $aTmetatagfound)) {
$code = str_replace($aTmetatagfound[1], $oMetaTagGen->render() . "\n", $code);
} else if (array_key_exists("charset", $value)
&& preg_match('/(<meta(?:\s+)charset(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(.*)(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(?:\s*|\/)(?:[\^\>]+)\r?\n?)/i', $code, $aTmetatagfound)) {

Datei anzeigen

@ -208,12 +208,13 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
preg_match_all("/CMS_CONTAINER\[([0-9]*)\]/", $code, $a_container);
$iPosBody = stripos($code, '<body>');
$sCodeBeforeHeader = substr($code, 0, $iPosBody);
foreach ($a_container[1] as $value) {
if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) {
$containerinf[$idlay][$value]["is_body"] = false;
} else {
$containerinf[$idlay][$value]["is_body"] = true;
if (!empty($a_container)) {
foreach ($a_container[1] as $value) {
if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) {
$containerinf[$idlay][$value]["is_body"] = false;
} else {
$containerinf[$idlay][$value]["is_body"] = true;
}
}
}
@ -230,11 +231,13 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
$container[] = $value;
}
}
asort($container);
if (is_array($container)) {
if (is_array($container) && !empty($container)) {
$tmp_returnstring = implode("&", $container);
} else {
$tmp_returnstring = "";
}
return $tmp_returnstring;
}
@ -291,7 +294,7 @@ function tplGetContainerTypes($idlay, $container) {
global $db;
global $cfg;
global $containerinf;
$list = array();
if (is_array($containerinf[$idlay])) {
@ -359,16 +362,14 @@ function tplPreparseLayout($idlay, $raw_code = NULL) {
if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) {
$idcontainer = $parser->iNodeAttributes["id"];
$mode = $parser->iNodeAttributes["mode"];
if ($mode == "") {
$mode = "optional";
}
$sMode = (isset($parser->iNodeAttributes["mode"]))?$parser->iNodeAttributes["mode"]:'optional';
$sDefault = (isset($parser->iNodeAttributes["default"]))?$parser->iNodeAttributes["default"]:'';
$sTypes = (isset($parser->iNodeAttributes["types"]))?$parser->iNodeAttributes["types"]:'';
$containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"];
$containerinf[$idlay][$idcontainer]["mode"] = $mode;
$containerinf[$idlay][$idcontainer]["default"] = $parser->iNodeAttributes["default"];
$containerinf[$idlay][$idcontainer]["types"] = $parser->iNodeAttributes["types"];
$containerinf[$idlay][$idcontainer]["mode"] = $sMode;
$containerinf[$idlay][$idcontainer]["default"] = $sDefault;
$containerinf[$idlay][$idcontainer]["types"] = $sTypes;
$containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody;
}
}
@ -726,7 +727,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer FROM " . $cfg["tab"]["container"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";
$db_autofill->query($sql);
@ -760,7 +760,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer, idmod FROM " . $cfg["tab"]["container"]
. " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";

Datei anzeigen

@ -805,7 +805,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
$newfilename = "";
if (!is_array($cfg['upl']['allow_additional_chars'])) {
if (!isset($cfg['upl']['allow_additional_chars']) || !is_array($cfg['upl']['allow_additional_chars'])) {
$filename = str_replace(" ", $spacer, $filename);
} elseif (in_array(' ', $cfg['upl']['allow_additional_chars']) === FALSE) {
$filename = str_replace(" ", $spacer, $filename);
@ -826,7 +826,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
}
#Check for additionally allowed charcaters in $cfg['upl']['allow_additional_chars'] (must be array of chars allowed)
if (is_array($cfg['upl']['allow_additional_chars']) && !$bFound) {
if (isset($cfg['upl']['allow_additional_chars']) && is_array($cfg['upl']['allow_additional_chars']) && !$bFound) {
if (in_array($atom, $cfg['upl']['allow_additional_chars'])) {
$newfilename .= $atom;
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,9 +28,8 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
$tpl->set('s', 'CLASS', 'text_medium');
@ -42,7 +42,6 @@ $tpl->set('s', 'SID', $sess->id);
$clients = $classclient->getAccessibleClients();
$tpl2 = new Template;
$tpl2->set('s', 'ID', 'editclient');
$tpl2->set('s', 'NAME', 'editclient');
@ -53,23 +52,20 @@ $iClientcount = count($clients);
foreach ($clients as $key => $value) {
if ($client == $key)
{
$selected = "selected";
} else {
$selected = "";
}
if ($client == $key) {
$selected = "selected";
} else {
$selected = "";
}
if (strlen($value['name']) > 15)
{
$value['name'] = substr($value['name'],0,12). "...";
}
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value['name']);
$tpl2->set('d', 'SELECTED', $selected);
$tpl2->next();
if (strlen($value['name']) > 15) {
$value['name'] = substr($value['name'], 0, 12) . "...";
}
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value['name']);
$tpl2->set('d', 'SELECTED', $selected);
$tpl2->next();
}
$select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true);
@ -77,13 +73,11 @@ $select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic
$tpl->set('s', 'CLIENTSELECT', $select);
if ($perm->have_perm_area_action($area, "lang_newlanguage") && $iClientcount > 0) {
$tpl->set('s', 'NEWLANG', '<a class="addfunction" href="javascript:languageNewConfirm()">'.i18n("Create language").'</a>');
$tpl->set('s', 'NEWLANG', '<a class="addfunction" href="javascript:languageNewConfirm()">' . i18n("Create language") . '</a>');
} else if ($iClientcount == 0) {
$tpl->set('s', 'NEWLANG', i18n('No Client selected'));
} else {
$tpl->set('s', 'NEWLANG', '');
}
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['lang_left_top']);
?>
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['lang_left_top']);

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,16 +28,18 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// check request
$_REQUEST["sortby"] = (empty($_REQUEST["sortby"]))?'': htmlspecialchars($_REQUEST["sortby"]);
$_REQUEST["sortorder"] = (empty($_REQUEST["sortorder"]))?'': htmlspecialchars($_REQUEST["sortorder"]);
$_REQUEST["filter"] = (empty($_REQUEST["filter"]))?'': htmlspecialchars($_REQUEST["filter"]);
$oUser = new cApiUser($auth->auth["uid"]);
if (!isset($elemperpage) || !is_numeric($elemperpage) || $elemperpage < 0)
{
$elemperpage = $oUser->getProperty("itemsperpage", $area);
if (!isset($elemperpage) || !is_numeric($elemperpage) || $elemperpage < 0) {
$elemperpage = $oUser->getProperty("itemsperpage", $area);
$_REQUEST['elemperpage'] = $elemperpage;
if ((int) $elemperpage <= 0) {
$oUser->setProperty("itemsperpage", $area, 25);
@ -66,31 +69,28 @@ $tpl->set('s', 'OPTIONS', '');
$tpl->set('s', 'SID', $sess->id);
$tpl->set('s', 'SESSID', $sess->id);
$tpl2 = new Template;
$tpl2->set('s', 'NAME', 'restrict');
$tpl2->set('s', 'CLASS', 'text_medium');
$tpl2->set('s', 'OPTIONS', 'onchange="userChangeRestriction()"');
$limit = array(
"2" => i18n("All"),
"1" => i18n("Frontend only"),
"3" => i18n("Backend only"));
"2" => i18n("All"),
"1" => i18n("Frontend only"),
"3" => i18n("Backend only"));
foreach ($limit as $key => $value) {
if ($restrict == $key)
{
$selected = "selected";
} else {
$selected = "";
}
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value);
$tpl2->set('d', 'SELECTED', $selected);
$tpl2->next();
if (!empty($restrict) && $restrict == $key) {
$selected = "selected";
} else {
$selected = "";
}
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value);
$tpl2->set('d', 'SELECTED', $selected);
$tpl2->next();
}
$select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true);
@ -100,9 +100,9 @@ $tpl->set('s', 'ACTION', '');
$tmp_mstr = '<div style="margin: 0pt 0pt 0pt 17px; height: 2em; padding-bottom: 5px;">
<a class="addfunction" href="javascript:conMultiLink(\'%s\', \'%s\')">%s</a></div>';
$area = "user";
$mstr = sprintf($tmp_mstr, 'right_bottom',$sess->url("main.php?area=user_create&frame=4"),i18n("Create user"));
$mstr = sprintf($tmp_mstr, 'right_bottom', $sess->url("main.php?area=user_create&frame=4"), i18n("Create user"));
if ($perm->have_perm_area_action('user_create', "user_createuser")) {
if ($perm->have_perm_area_action('user_create', "user_createuser")) {
$tpl->set('s', 'NEWUSER', $mstr);
} else {
$tpl->set('s', 'NEWUSER', '');
@ -112,15 +112,15 @@ $tpl->set('s', 'CAPTION', '');
#################
# List Options
#################
$aSortByOptions = array( "username" => i18n("User name"),
"realname" => i18n("Name"));
$aSortOrderOptions = array( "asc" => i18n("Ascending"),
"desc" => i18n("Descending"));
$aSortByOptions = array("username" => i18n("User name"),
"realname" => i18n("Name"));
$listOptionId="listoption";
$aSortOrderOptions = array("asc" => i18n("Ascending"),
"desc" => i18n("Descending"));
$listOptionId = "listoption";
$tpl->set('s', 'LISTOPLINK', $listOptionId);
$oListOptionRow = new cFoldingRow( "5498dbba-ed4a-4618-8e49-3a3635396e22", i18n("List options"), $listOptionId);
$oListOptionRow = new cFoldingRow("5498dbba-ed4a-4618-8e49-3a3635396e22", i18n("List options"), $listOptionId);
$oListOptionRow->setExpanded('true');
$oSelectItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelectItemsPerPage->autoFill(array(25 => 25, 50 => 50, 75 => 75, 100 => 100));
@ -137,31 +137,31 @@ $oSelectSortOrder->setDefault($_REQUEST["sortorder"]);
$oTextboxFilter = new cHTMLTextbox("filter", $_REQUEST["filter"], 20);
$oTextboxFilter->setStyle('width:114px;');
$content = '<div style="border-bottom: 1px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">';
$content .= '<form action="javascript:execFilter(\''.$sess->id.'\');" id="filter" name="filter" method="get">';
$content = '<div style="border-bottom: 1px solid #B3B3B3; padding-left: 17px; background: ' . $cfg['color']['table_dark'] . ';">';
$content .= '<form action="javascript:execFilter(\'' . $sess->id . '\');" id="filter" name="filter" method="get">';
$content .= '<table>';
$content .= '<input type="hidden" name="area" value="'.$area.'">';
$content .= '<input type="hidden" name="area" value="' . $area . '">';
$content .= '<input type="hidden" name="frame" value="1">';
$content .= '<input type="hidden" name="contenido" value="'.$sess->id.'">';
$content .= '<input type="hidden" name="contenido" value="' . $sess->id . '">';
$content .= '<tr>';
$content .= '<td>'. i18n("Items / page").'</td>';
$content .= '<td>'.$oSelectItemsPerPage->render().'</td>';
$content .= '<td>' . i18n("Items / page") . '</td>';
$content .= '<td>' . $oSelectItemsPerPage->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>'. i18n("Sort by").'</td>';
$content .= '<td>'.$oSelectSortBy->render().'</td>';
$content .= '<td>' . i18n("Sort by") . '</td>';
$content .= '<td>' . $oSelectSortBy->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>'. i18n("Sort order").'</td>';
$content .= '<td>'.$oSelectSortOrder->render().'</td>';
$content .= '<td>' . i18n("Sort order") . '</td>';
$content .= '<td>' . $oSelectSortOrder->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>'. i18n("Search for").'</td>';
$content .= '<td>'.$oTextboxFilter->render().'</td>';
$content .= '<td>' . i18n("Search for") . '</td>';
$content .= '<td>' . $oTextboxFilter->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>&nbsp;</td>';
$content .= '<td><input type="submit" value="'.i18n("Apply").'"></td>';
$content .= '<td><input type="submit" value="' . i18n("Apply") . '"></td>';
$content .= '</tr>';
$content .= '</table>';
$content .= '</form>';
@ -172,7 +172,7 @@ $tpl->set('s', 'LISTOPTIONS', $oListOptionRow->render());
#########
# Paging
#########
$cApiUserCollection = new cApiUserCollection;
$cApiUserCollection = new cApiUserCollection;
$cApiUserCollection->query();
$iItemCount = $cApiUserCollection->count();
@ -188,12 +188,12 @@ $oPagerLink->setCustom("area", $area);
$oPagerLink->enableAutomaticParameterAppend();
$oPagerLink->setCustom("contenido", $sess->id);
$pagerID="pager";
$pagerID = "pager";
$page = (isset($page))?$page:1;
$oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID);
$oPager->setExpanded('true');
$tpl->set('s', 'PAGINGLINK', $pagerID);
$tpl->set('s', 'PAGING', $oPager->render());
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_left_top']);
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,9 +29,8 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -40,25 +40,27 @@ $cApiUserCollection = new cApiUserCollection;
$cApiUserCollection->query();
$iSumUsers = $cApiUserCollection->count();
if (isset($_REQUEST["sortby"]) && $_REQUEST["sortby"] != "")
{
$cApiUserCollection->setOrder($_REQUEST["sortby"]. " ". $_REQUEST["sortorder"]);
} else {
$cApiUserCollection->setOrder("username asc");
if (empty($_REQUEST["sortby"])) {
$_REQUEST["sortby"] = 'username';
$_REQUEST["sortorder"] = 'asc';
$cApiUserCollection->setOrder("username asc");
}
if (isset($_REQUEST["filter"]) && $_REQUEST["filter"] != "")
{
$cApiUserCollection->setWhereGroup("default", "username", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "realname", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "email", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "telephone", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_street", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_zip", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_city", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_country", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setInnerGroupCondition("default", "OR");
$cApiUserCollection->setOrder($_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]);
if (!empty($_REQUEST["filter"])) {
$cApiUserCollection->setWhereGroup("default", "username", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "realname", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "email", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "telephone", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_street", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_zip", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_city", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_country", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setInnerGroupCondition("default", "OR");
} else {
$_REQUEST["filter"] = '';
}
$cApiUserCollection->query();
@ -67,108 +69,87 @@ $aCurrentUserAccessibleClients = $classclient->getAccessibleClients();
$iMenu = 0;
$iItemCount = 0;
$mPage = $_REQUEST["page"];
$mPage = (isset($_REQUEST["page"])) ? (int) $_REQUEST["page"] : 1;
if ($mPage == 0)
{
$mPage = 1;
}
$elemperpage = $_REQUEST["elemperpage"];
if ($elemperpage == 0)
{
$elemperpage = 25;
}
$elemperpage = (isset($_REQUEST["elemperpage"])) ? (int) $_REQUEST["elemperpage"] : 25;
$mlist = new UI_Menu;
$sToday = date('Y-m-d');
if (($elemperpage*$mPage) >= $iSumUsers+$elemperpage && $mPage != 1) {
if (($elemperpage * $mPage) >= $iSumUsers + $elemperpage && $mPage != 1) {
$_REQUEST["page"]--;
$mPage--;
}
while ($cApiUser = $cApiUserCollection->next())
{
$userid = $cApiUser->get("user_id");
$aUserPermissions = explode(',', $cApiUser->get('perms'));
$bDisplayUser = false;
while ($cApiUser = $cApiUserCollection->next()) {
$userid = $cApiUser->get("user_id");
if (in_array("sysadmin", $aCurrentUserPermissions))
{
$aUserPermissions = explode(',', $cApiUser->get('perms'));
$bDisplayUser = false;
if (in_array("sysadmin", $aCurrentUserPermissions)) {
$bDisplayUser = true;
}
foreach ($aCurrentUserAccessibleClients as $key => $value)
{
if (in_array("client[$key]", $aUserPermissions))
{
foreach ($aCurrentUserAccessibleClients as $key => $value) {
if (in_array("client[$key]", $aUserPermissions)) {
$bDisplayUser = true;
}
}
foreach ($aUserPermissions as $sLocalPermission)
{
if (in_array($sLocalPermission, $aCurrentUserPermissions))
{
foreach ($aUserPermissions as $sLocalPermission) {
if (in_array($sLocalPermission, $aCurrentUserPermissions)) {
$bDisplayUser = true;
}
}
}
$link = new cHTMLLink;
$link->setMultiLink("user", "", "user_overview", "");
$link->setCustom("userid", $cApiUser->get("user_id"));
if ($bDisplayUser == true)
{
$iItemCount++;
if ($iItemCount > ($elemperpage * ($mPage - 1)) && $iItemCount < (($elemperpage * $mPage) + 1))
{
if ($perm->have_perm_area_action('user',"user_delete") ) {
$message = sprintf(i18n("Do you really want to delete the user %s?"), $cApiUser->get("username"));
$delTitle = i18n("Delete user");
$deletebutton = '<a title="'.$delTitle.'" href="javascript://" onclick="box.confirm(\''.$delTitle.'\', \''.$message.'\', \'deleteBackenduser(\\\''.$userid.'\\\')\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$delTitle.'" alt="'.$delTitle.'"></a>';
} else {
$deletebutton = "";
}
if ($bDisplayUser == true) {
$iItemCount++;
$iMenu++;
if (($sToday < $cApiUser->get("valid_from")
&& $cApiUser->get("valid_from") != '0000-00-00'
&& $cApiUser->get("valid_from") != '1000-01-01'
if ($iItemCount > ($elemperpage * ($mPage - 1)) && $iItemCount < (($elemperpage * $mPage) + 1)) {
if ($perm->have_perm_area_action('user', "user_delete")) {
$message = sprintf(i18n("Do you really want to delete the user %s?"), $cApiUser->get("username"));
$delTitle = i18n("Delete user");
$deletebutton = '<a title="' . $delTitle . '" href="javascript://" onclick="box.confirm(\'' . $delTitle . '\', \'' . $message . '\', \'deleteBackenduser(\\\'' . $userid . '\\\')\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $delTitle . '" alt="' . $delTitle . '"></a>';
} else {
$deletebutton = "";
}
$iMenu++;
if (($sToday < $cApiUser->get("valid_from")
&& $cApiUser->get("valid_from") != '0000-00-00'
&& $cApiUser->get("valid_from") != '1000-01-01'
&& $cApiUser->get("valid_from") != '')
|| ($sToday > $cApiUser->get("valid_to")
&& $cApiUser->get("valid_to") != '0000-00-00'
&& $cApiUser->get("valid_to") != '1000-01-01'
&& $cApiUser->get("valid_from") != '')) {
$mlist->setTitle($iMenu, '<span style="color:#b3b3b8">'.$cApiUser->get("username")."<br>".$cApiUser->get("realname").'</span>');
} else {
$mlist->setTitle($iMenu, $cApiUser->get("username")."<br>".$cApiUser->get("realname"));
}
|| ($sToday > $cApiUser->get("valid_to")
&& $cApiUser->get("valid_to") != '0000-00-00'
&& $cApiUser->get("valid_to") != '1000-01-01'
&& $cApiUser->get("valid_from") != '')) {
$mlist->setTitle($iMenu, '<span style="color:#b3b3b8">' . $cApiUser->get("username") . "<br>" . $cApiUser->get("realname") . '</span>');
} else {
$mlist->setTitle($iMenu, $cApiUser->get("username") . "<br>" . $cApiUser->get("realname"));
}
$mlist->setLink($iMenu, $link);
$mlist->setActions($iMenu, "delete", $deletebutton);
if ($_GET['userid'] == $cApiUser->get("user_id")) {
$mlist->setLink($iMenu, $link);
$mlist->setActions($iMenu, "delete", $deletebutton);
if (!empty($_GET['userid']) && $_GET['userid'] == $cApiUser->get("user_id")) {
$mlist->setExtra($iMenu, 'id="marked" ');
}
}
}
}
}
$deleteScript = '<script type="text/javascript">
/* Session-ID */
var sid = "'.$sess->id.'";
var sid = "' . $sess->id . '";
/* Create messageBox
instance */
@ -191,26 +172,26 @@ $deleteScript = '<script type="text/javascript">
url += \'&sortorder=\' +form.sortorder.value;
url += \'&filter=\' +form.filter.value;
url += \'&elemperpage=\' +form.elemperpage.value;
url += \'&page=\' +\''.$mPage.'\';
url += \'&page=\' +\'' . $mPage . '\';
parent.parent.right.right_bottom.location.href = url;
parent.parent.right.right_top.location.href = \'main.php?area=user&frame=3&contenido=\'+sid;
}
</script>';
$markActiveScript = '<script type="text/javascript">
if (document.getElementById(\'marked\')) {
row.markedRow = document.getElementById(\'marked\');
}
</script>';
//<script type="text/javascript" src="scripts/rowMark.js"></script>
//<script type="text/javascript" src="scripts/rowMark.js"></script>
$oPage->setMargin(0);
$oPage->addScript('rowMark.js', '<script language="JavaScript" src="scripts/rowMark.js"></script>');
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>');
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>');
$oPage->addScript('delete', $deleteScript);
$oPage->setContent($mlist->render(false).$markActiveScript);
$oPage->setContent($mlist->render(false) . $markActiveScript);
//generate current content for Object Pager
$oPagerLink = new cHTMLLink;
@ -225,10 +206,10 @@ $oPagerLink->setCustom("area", $area);
$oPagerLink->enableAutomaticParameterAppend();
$oPagerLink->setCustom("contenido", $sess->id);
$pagerID="pager";
$pagerID = "pager";
$page = (empty($page))?1:(int)$page;
$oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID);
//add slashes, to insert in javascript
$sPagerContent = $oPager->render(1);
$sPagerContent = str_replace('\\', '\\\\', $sPagerContent);
@ -237,7 +218,7 @@ $sPagerContent = str_replace('\'', '\\\'', $sPagerContent);
//send new object pager to left_top
$sRefreshPager = '
<script type="text/javascript">
var sNavigation = \''.$sPagerContent.'\';
var sNavigation = \'' . $sPagerContent . '\';
var left_top = parent.left_top;
if (left_top.document) {
var oPager = left_top.document.getElementById(\'44b41691-0dd4-443c-a594-66a8164e25fd\');
@ -249,8 +230,6 @@ $sRefreshPager = '
}
}
</script>';
$oPage->addScript('refreshpager', $sRefreshPager);
$oPage->addScript('refreshpager', $sRefreshPager);
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -35,15 +36,13 @@
* TODO error handling!!!
* TODO export functions to new ConUser object!
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude('includes', 'functions.rights.php');
if (!($perm->have_perm_area_action($area, $action) || $perm->have_perm_area_action('user', $action))) {
// access denied
$notification->displayNotification("error", i18n("Permission denied"));
@ -55,8 +54,8 @@ if (!isset($userid)) {
return;
}
$aPerms = array();
$bError = false;
$aPerms = array();
$bError = false;
$sNotification = '';
// delete user
@ -65,11 +64,11 @@ if ($action == 'user_delete') {
$oUsers->deleteUserByID($userid);
$sql = "DELETE FROM " . $cfg["tab"]["groupmembers"]
. " WHERE user_id = '" . Contenido_Security::escapeDB($userid, $db) . "'";
. " WHERE user_id = '" . Contenido_Security::escapeDB($userid, $db) . "'";
$db->query($sql);
$sql = "DELETE FROM " . $cfg["tab"]["rights"]
." WHERE user_id = '" . Contenido_Security::escapeDB($userid, $db) . "'";
. " WHERE user_id = '" . Contenido_Security::escapeDB($userid, $db) . "'";
$db->query($sql);
$sNotification = $notification->displayNotification("info", i18n("User deleted"));
@ -87,7 +86,7 @@ if ($action == 'user_delete') {
</body>
</html>
';
$tpl->reset();
$tpl->set('s', 'NOTIFICATION', $sNotification);
$tpl->generate($sTemplate);
@ -158,13 +157,19 @@ $oUser = new User();
$oUser->loadUserByUserID(Contenido_Security::escapeDB($userid, $db));
// delete user property
if (is_string($del_userprop_type) && is_string($del_userprop_name)) {
if (!empty($del_userprop_type)
&& !empty($del_userprop_name)
&& is_string($del_userprop_type)
&& is_string($del_userprop_name)) {
$oUser->deleteUserProperty($del_userprop_type, $del_userprop_name);
}
// edit user property
if (is_string($userprop_type) && is_string($userprop_name) && is_string($userprop_value)
&& !empty($userprop_type) && !empty($userprop_name)) {
if (!empty($userprop_type)
&& !empty($userprop_name)
&& is_string($userprop_type)
&& is_string($userprop_name)
&& is_string($userprop_value)) {
$oUser->setUserProperty($userprop_type, $userprop_name, $userprop_value);
}
@ -174,16 +179,16 @@ if (count($aPerms) == 0 || $action == '' || !isset($action)) {
$tpl->reset();
$tpl->set('s','SID', $sess->id);
$tpl->set('s','NOTIFICATION', $sNotification);
$tpl->set('s', 'SID', $sess->id);
$tpl->set('s', 'NOTIFICATION', $sNotification);
$form = '<form name="user_properties" method="post" action="'.$sess->url("main.php?").'">
'.$sess->hidden_session(true).'
<input type="hidden" name="area" value="'.$area.'">
$form = '<form name="user_properties" method="post" action="' . $sess->url("main.php?") . '">
' . $sess->hidden_session(true) . '
<input type="hidden" name="area" value="' . $area . '">
<input type="hidden" name="action" value="user_edit">
<input type="hidden" name="frame" value="'.$frame.'">
<input type="hidden" name="userid" value="'.$userid.'">
<input type="hidden" name="idlang" value="'.$lang.'">';
<input type="hidden" name="frame" value="' . $frame . '">
<input type="hidden" name="userid" value="' . $userid . '">
<input type="hidden" name="idlang" value="' . $lang . '">';
$tpl->set('s', 'FORM', $form);
$tpl->set('s', 'GET_USERID', $userid);
@ -193,9 +198,8 @@ $tpl->set('s', 'SUBMITTEXT', i18n("Save changes"));
$tpl->set('s', 'CANCELTEXT', i18n("Discard changes"));
$tpl->set('s', 'CANCELLINK', $sess->url("main.php?area=$area&frame=4&userid=$userid"));
$tpl->set('d', 'CATNAME', i18n("Property"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_header"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_header"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'CATFIELD', i18n("Value"));
$tpl->next();
@ -203,7 +207,7 @@ $tpl->next();
$tpl->set('d', 'CATNAME', i18n("Username"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'CATFIELD', $oUser->getField('username').'<img align="top" src="images/spacer.gif" height="20">');
$tpl->set('d', 'CATFIELD', $oUser->getField('username') . '<img align="top" src="images/spacer.gif" height="20">');
$tpl->next();
$tpl->set('d', 'CATNAME', i18n("Name"));
@ -213,7 +217,7 @@ $tpl->set('d', 'CATFIELD', formGenerateField("text", "realname", $oUser->getFiel
$tpl->next();
// @since 2006-07-04 Display password fields only if not authenticated via LDAP/AD
if ($msysadmin || $oUser->getField('password') != 'active_directory_auth') {
if ((isset($msysadmin) && $msysadmin) || $oUser->getField('password') != 'active_directory_auth') {
$tpl->set('d', 'CATNAME', i18n("New password"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
@ -280,14 +284,14 @@ $oClientsCollection = new cApiClientCollection();
$aClients = $oClientsCollection->getAvailableClients();
$sClientCheckboxes = '';
foreach ($aClients as $idclient => $item) {
if (in_array("admin[".$idclient."]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms)){
$sClientCheckboxes .= formGenerateCheckbox("madmin[".$idclient."]", $idclient, in_array("admin[".$idclient."]", $aPerms), $item['name']." (".$idclient.")")."<br>";
if (in_array("admin[" . $idclient . "]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("madmin[" . $idclient . "]", $idclient, in_array("admin[" . $idclient . "]", $aPerms), $item['name'] . " (" . $idclient . ")") . "<br>";
}
}
if ($sClientCheckboxes !== '' && !in_array('sysadmin', $aPerms)) {
$tpl->set('d', 'CATNAME', i18n("Administrator"));
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_dark"]);
$tpl->set('d', 'CATFIELD', $sClientCheckboxes);
$tpl->next();
@ -296,14 +300,14 @@ if ($sClientCheckboxes !== '' && !in_array('sysadmin', $aPerms)) {
// clients perms
$sClientCheckboxes = '';
foreach ($aClients as $idclient => $item) {
if ((in_array("client[".$idclient."]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms) || in_array("admin[".$idclient."]", $aAuthPerms)) && !in_array("admin[".$idclient."]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mclient[".$idclient."]", $idclient, in_array("client[".$idclient."]", $aPerms), $item['name']." (". $idclient . ")")."<br>";
if ((in_array("client[" . $idclient . "]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms) || in_array("admin[" . $idclient . "]", $aAuthPerms)) && !in_array("admin[" . $idclient . "]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mclient[" . $idclient . "]", $idclient, in_array("client[" . $idclient . "]", $aPerms), $item['name'] . " (" . $idclient . ")") . "<br>";
}
}
if ($sClientCheckboxes !== '' && !in_array('sysadmin', $aPerms)) {
$tpl->set('d', 'CATNAME', i18n("Access clients"));
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'CATFIELD', $sClientCheckboxes);
$tpl->next();
@ -313,14 +317,14 @@ if ($sClientCheckboxes !== '' && !in_array('sysadmin', $aPerms)) {
$aClientsLanguages = getAllClientsAndLanguages();
$sClientCheckboxes = '';
foreach ($aClientsLanguages as $item) {
if (($perm->have_perm_client("lang[".$item['idlang']."]") || $perm->have_perm_client("admin[".$item['idclient']."]")) && !in_array("admin[".$item['idclient']."]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mlang[".$item['idlang']."]", $item['idlang'], in_array("lang[".$item['idlang']."]", $aPerms), $item['langname']." (". $item['clientname'] .")") ."<br>";
if (($perm->have_perm_client("lang[" . $item['idlang'] . "]") || $perm->have_perm_client("admin[" . $item['idclient'] . "]")) && !in_array("admin[" . $item['idclient'] . "]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mlang[" . $item['idlang'] . "]", $item['idlang'], in_array("lang[" . $item['idlang'] . "]", $aPerms), $item['langname'] . " (" . $item['clientname'] . ")") . "<br>";
}
}
if ($sClientCheckboxes != '' && !in_array('sysadmin', $aPerms)) {
$tpl->set('d', 'CATNAME', i18n("Access languages"));
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_dark"]);
$tpl->set('d', 'CATFIELD', $sClientCheckboxes);
$tpl->next();
@ -329,11 +333,11 @@ if ($sClientCheckboxes != '' && !in_array('sysadmin', $aPerms)) {
// user properties
$aProperties = $oUser->getUserProperties();
$sPropRows = '';
$sPropRows = '';
foreach ($aProperties as $entry) {
$type = $entry['type'];
if ($type != 'system') {
$name = $entry['name'];
$name = $entry['name'];
$value = $entry['value'];
$sPropRows .= '
<tr class="text_medium">
@ -347,11 +351,11 @@ foreach ($aProperties as $entry) {
}
}
$table = '
<table width="100%" cellspacing="0" cellpadding="2" style="border:1px solid '.$cfg["color"]["table_border"].';">
<tr style="background-color:'.$cfg["color"]["table_header"].'" class="text_medium">
<td>'.i18n("Area/Type").'</td>
<td>'.i18n("Property").'</td>
<td>'.i18n("Value").'</td>
<table width="100%" cellspacing="0" cellpadding="2" style="border:1px solid ' . $cfg["color"]["table_border"] . ';">
<tr style="background-color:' . $cfg["color"]["table_header"] . '" class="text_medium">
<td>' . i18n("Area/Type") . '</td>
<td>' . i18n("Property") . '</td>
<td>' . i18n("Value") . '</td>
<td>&nbsp;</td>
</tr>
' . $sPropRows . '
@ -364,7 +368,7 @@ $table = '
</table>';
$tpl->set('d', 'CATNAME', i18n("User-defined properties"));
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'CATFIELD', $table);
$tpl->next();
@ -383,9 +387,9 @@ $sCurrentValueFrom = trim(str_replace('1000-01-01', '', $sCurrentValueFrom));
$sInputValidFrom = '<style type="text/css">@import url(./scripts/jscalendar/calendar-contenido.css);</style>
<script type="text/javascript" src="./scripts/jscalendar/calendar.js"></script>
<script type="text/javascript" src="./scripts/jscalendar/lang/calendar-'.substr(strtolower($belang),0,2).'.js"></script>
<script type="text/javascript" src="./scripts/jscalendar/lang/calendar-' . substr(strtolower($belang), 0, 2) . '.js"></script>
<script type="text/javascript" src="./scripts/jscalendar/calendar-setup.js"></script>';
$sInputValidFrom .= '<input type="text" id="valid_from" name="valid_from" value="'.$sCurrentValueFrom.'" />&nbsp;<img src="images/calendar.gif" id="trigger" /">';
$sInputValidFrom .= '<input type="text" id="valid_from" name="valid_from" value="' . $sCurrentValueFrom . '" />&nbsp;<img src="images/calendar.gif" id="trigger" /">';
$sInputValidFrom .= '<script type="text/javascript">
Calendar.setup({
inputField: "valid_from",
@ -406,7 +410,7 @@ $sCurrentValueTo = str_replace('00:00:00', '', $oUser->getField('valid_to'));
$sCurrentValueTo = trim(str_replace('0000-00-00', '', $sCurrentValueTo));
$sCurrentValueTo = trim(str_replace('1000-01-01', '', $sCurrentValueTo));
$sInputValidTo = '<input type="text" id="valid_to" name="valid_to" value="'.$sCurrentValueTo.'" />&nbsp;<img src="images/calendar.gif" id="trigger_to" /">';
$sInputValidTo = '<input type="text" id="valid_to" name="valid_to" value="' . $sCurrentValueTo . '" />&nbsp;<img src="images/calendar.gif" id="trigger_to" /">';
$sInputValidTo .= '<script type="text/javascript">
Calendar.setup({
inputField: "valid_to",
@ -418,7 +422,7 @@ $sInputValidTo .= '<script type="text/javascript">
</script>';
$tpl->set('d', 'CATNAME', i18n("Valid to"));
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'CATFIELD', $sInputValidTo);
$tpl->next();
@ -445,7 +449,7 @@ if (($sCurrentValueFrom > $sCurrentDate) || ($sCurrentValueTo < $sCurrentDate))
$tpl->set('d', 'CATNAME', '&nbsp;');
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_dark"]);
$tpl->set('d', 'CATFIELD', '<span style="color:'.$sAccountColor.';">'.$sAccountState.'</span>');
$tpl->set('d', 'CATFIELD', '<span style="color:' . $sAccountColor . ';">' . $sAccountState . '</span>');
$tpl->next();
// Show backend user's group memberships
@ -458,12 +462,11 @@ if (count($aGroups) > 0) {
}
$tpl->set('d', 'CATNAME', i18n("Group membership"));
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_dark"]);
$tpl->set('d', 'CATFIELD', $sGroups);
$tpl->next();
// Generate template
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_overview']);
?>

Datei anzeigen

@ -111,6 +111,7 @@ $aManagedProperties = array(
);
$aSettings = getSystemProperties(1);
$sNotification = '';
if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) {
$bStored = false;
@ -192,5 +193,4 @@ if ($perm->have_perm_area_action($area, 'edit_sysconf')) {
$oPage->setContent($notification->returnNotification("error", i18n('Access denied'), 1));
}
$oPage->addScript('setMenu', $sJs);
$oPage->render();
?>
$oPage->render();

Datei anzeigen

@ -38,6 +38,7 @@ $aManagedValues = array('versioning_prune_limit', 'update_check', 'update_news_f
'system_mail_sender_name', 'pw_request_enable', 'maintenance_mode', 'edit_area_activated',
'backend_preferred_idclient', 'generator_basehref', 'generator_xhtml', 'imagemagick_available',
'system_insight_editing_activated');
$sWarning = '';
if ($action == "systemsettings_save_item") {
if (!in_array($systype . '_' . $sysname, $aManagedValues)) {

Datei anzeigen

@ -44,14 +44,14 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
}
$sql = "SELECT
a.idtpl, a.name as name, a.description, a.idlay, b.description as laydescription, a.defaulttemplate
FROM
" . $cfg['tab']['tpl'] . " AS a
LEFT JOIN
" . $cfg['tab']['lay'] . " AS b
ON a.idlay=b.idlay
WHERE a.idtpl='" . Contenido_Security::toInteger($idtpl) . "'
ORDER BY name";
a.idtpl, a.name as name, a.description, a.idlay, b.description as laydescription, a.defaulttemplate
FROM
" . $cfg['tab']['tpl'] . " AS a
LEFT JOIN
" . $cfg['tab']['lay'] . " AS b
ON a.idlay=b.idlay
WHERE a.idtpl='" . Contenido_Security::toInteger($idtpl) . "'
ORDER BY name";
$db->query($sql);
@ -65,11 +65,11 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
}
$sql = "SELECT
number, idmod
FROM
" . $cfg['tab']['container'] . "
WHERE
idtpl='" . Contenido_Security::toInteger($idtpl) . "'";
number, idmod
FROM
" . $cfg['tab']['container'] . "
WHERE
idtpl='" . Contenido_Security::toInteger($idtpl) . "'";
$db->query($sql);
while ($db->next_record()) {
@ -93,12 +93,12 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$tpl2->next();
}
$sql = "SELECT
idlay, name
FROM
" . $cfg['tab']['lay'] . "
WHERE
idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY name";
idlay, name
FROM
" . $cfg['tab']['lay'] . "
WHERE
idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY name";
$db->query($sql);
@ -119,12 +119,12 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$select = $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
$sql = "SELECT
idmod, name, type
FROM
" . $cfg['tab']['mod'] . "
WHERE
idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY name";
idmod, name, type
FROM
" . $cfg['tab']['mod'] . "
WHERE
idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY name";
$db->query($sql);
@ -153,7 +153,6 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$descr = new cHTMLTextarea("description", $description);
$form->add(i18n("Description"), $descr->render());
$standardcb = new cHTMLCheckbox("vdefault", 1, "", $vdefault);
$form->add(i18n("Default"), $standardcb->toHTML(false));
@ -165,7 +164,13 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$raw_code = ($oLayout->virgin) ? "" : $oLayout->getLayout();
tplPreparseLayout($idlay, $raw_code);
$tmp_returnstring = tplBrowseLayoutForContainers($idlay, $raw_code);
$a_container = explode("&", $tmp_returnstring);
var_dump($tmp_returnstring);
if(empty($tmp_returnstring)) {
$a_container = [];
} else {
$a_container = explode("&", $tmp_returnstring);
}
foreach ($a_container as $key => $value) {
if ($value != 0) {
// Loop through containers ****************
@ -212,7 +217,7 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
}
$allowedtypes = tplGetContainerTypes($idlay, $value);
foreach ($modules as $key => $val) {
$option = new cHTMLOptionElement($val["name"], $key);
@ -250,5 +255,4 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
}
$page->render();
}
?>
}

@ -1 +1 @@
Subproject commit 3217b73d08e1b76193f02d2d912134320ef40bfe
Subproject commit 06cc337092ed649df1ec738816ba6a3e59a8af0b