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. * @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php * @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)]); return isset($this->attributes[strtolower($offset)]);
} }

Datei anzeigen

@ -174,10 +174,10 @@ class UI_Menu {
foreach ($this->link as $key => $value) { foreach ($this->link as $key => $value) {
if ($value != NULL) { 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] . '">'); $value->setContent('<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">');
$img = $value->render(); $img = $value->render();
} else { } else if(!empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '">'); $value->setContent('<img border="0" src="' . $this->image[$key] . '">');
$img = $value->render(); $img = $value->render();
} }
@ -186,14 +186,12 @@ class UI_Menu {
} else { } else {
$link = $this->title[$key]; $link = $this->title[$key];
if ($this->image[$key] != "") { if (!empty($this->image[$key])) {
if ($this->imagewidth[$key] != 0) { if ($this->imagewidth[$key] != 0) {
$img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">'; $img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">';
} else { } else {
$img = '<img border="0" src="' . $this->image[$key] . '">'; $img = '<img border="0" src="' . $this->image[$key] . '">';
} }
} else {
$img = "&nbsp;";
} }
} }
@ -212,21 +210,24 @@ class UI_Menu {
$bgColor = $cfg["color"]["table_light_active"]; $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"]; $bgColor = $cfg["color"]["table_light_active"];
} }
} }
$tpl->set('d', 'NAME', $link); $tpl->set('d', 'NAME', $link);
if ($this->image[$key] == "") { if (empty($this->image[$key])) {
$tpl->set('d', 'ICON', ''); $tpl->set('d', 'ICON', '');
} else { } else {
$tpl->set('d', 'ICON', $img); $tpl->set('d', 'ICON', $img);
} }
if ($this->extra[$key] != "" || $this->rowmark == true) { if (!empty($this->extra[$key]) || $this->rowmark == true) {
$extraadd = ""; $extraadd = "";
if(empty($this->extra[$key])) {
$this->extra[$key] = '';
}
if ($this->rowmark == true) { if ($this->rowmark == true) {
$extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"'; $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)) { if (is_array($this->items)) {
foreach ($this->items as $key => $value) { 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 = '<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>'; $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 { class Link {
var $alt = '';
var $link; var $link;
var $title; var $title;
var $targetarea; var $targetarea;
@ -770,7 +772,8 @@ class Link {
function render() { function render() {
global $sess, $cfg; global $sess, $cfg;
$custom = '';
$attributes = '';
if ($this->alt != "") { if ($this->alt != "") {
$alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" '; $alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" ';
} else { } else {
@ -819,7 +822,7 @@ class Link {
break; break;
} }
if ($this->images == '') { if (empty($this->images)) {
return ($link . $this->content . "</a>"); return ($link . $this->content . "</a>");
} else { } else {
list($this->img_width, $this->img_height, $this->img_type, $this->img_attr) = getimagesize($cfg['path']['contenido'] . $this->images); 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; $colcount = 0;
if (is_array($this->cells)) { if (is_array($this->cells)) {
$dark = true;
foreach ($this->cells as $row => $cells) { foreach ($this->cells as $row => $cells) {
$thefont = ''; $thefont = '';
$unne = ''; $unne = '';
@ -928,7 +932,7 @@ class UI_List {
$bgColor = $cfg["color"]["table_light"]; $bgColor = $cfg["color"]["table_light"];
} }
if ($this->bgcolor[$row] != "") { if (!empty($this->bgcolor[$row])) {
$bgColor = $this->bgcolor[$row]; $bgColor = $this->bgcolor[$row];
} }
@ -936,7 +940,7 @@ class UI_List {
$count = 0; $count = 0;
foreach ($cells as $key => $value) { foreach ($cells as $key => $value) {
$thefontDispl = $thefont . $this->extra[$row][$key]; $thefontDispl = $thefont . (empty($this->extra[$row][$key]))?'':$this->extra[$row][$key];
$count++; $count++;
$tpl2->reset(); $tpl2->reset();
@ -966,7 +970,7 @@ class UI_List {
$tpl2->set('s', 'ALIGN', 'left'); $tpl2->set('s', 'ALIGN', 'left');
} }
if ($this->cellvalignment[$row][$key] != "") { if (!empty($this->cellvalignment[$row][$key])) {
$tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]); $tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]);
} else { } else {
$tpl2->set('s', 'VALIGN', 'top'); $tpl2->set('s', 'VALIGN', 'top');

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -264,20 +264,19 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$template = $db->f("template"); $template = $db->f("template");
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
$varstring = array(); $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); $tmp2 = explode("=", $value1);
foreach ($tmp2 as $key2 => $value2) { foreach ($tmp2 as $key2 => $value2) {
$varstring["$tmp2[0]"] = $tmp2[1]; $varstring["$tmp2[0]"] = $tmp2[1];
}
} }
} }
$CiCMS_Var = '$C' . $value . 'CMS_VALUE'; $CiCMS_Var = '$C' . $value . 'CMS_VALUE';
$CiCMS_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 . '; ?' . '>'; $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 = 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>\'; ?' . '>'); $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 //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); array_push($metatags, $aAutValue);
} }
} }
@ -481,7 +480,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
foreach ($metatags as $value) { foreach ($metatags as $value) {
if (getEffectiveSetting('generator', 'html5', "false") == "true") { if (getEffectiveSetting('generator', 'html5', "false") == "true") {
if ($value['name'] == 'date') if (isset($value['name']) && $value['name'] == 'date')
continue; continue;
} }
if (!empty($value['content'])) { if (!empty($value['content'])) {
@ -497,7 +496,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$oMetaTagGen->removeAttribute("id"); $oMetaTagGen->removeAttribute("id");
/* Check if metatag already exists */ /* 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); $code = str_replace($aTmetatagfound[1], $oMetaTagGen->render() . "\n", $code);
} else if (array_key_exists("charset", $value) } else if (array_key_exists("charset", $value)
&& preg_match('/(<meta(?:\s+)charset(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(.*)(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(?:\s*|\/)(?:[\^\>]+)\r?\n?)/i', $code, $aTmetatagfound)) { && 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); preg_match_all("/CMS_CONTAINER\[([0-9]*)\]/", $code, $a_container);
$iPosBody = stripos($code, '<body>'); $iPosBody = stripos($code, '<body>');
$sCodeBeforeHeader = substr($code, 0, $iPosBody); $sCodeBeforeHeader = substr($code, 0, $iPosBody);
if (!empty($a_container)) {
foreach ($a_container[1] as $value) { foreach ($a_container[1] as $value) {
if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) { if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) {
$containerinf[$idlay][$value]["is_body"] = false; $containerinf[$idlay][$value]["is_body"] = false;
} else { } else {
$containerinf[$idlay][$value]["is_body"] = true; $containerinf[$idlay][$value]["is_body"] = true;
}
} }
} }
@ -230,11 +231,13 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
$container[] = $value; $container[] = $value;
} }
} }
asort($container); asort($container);
if (is_array($container)) { if (is_array($container) && !empty($container)) {
$tmp_returnstring = implode("&", $container); $tmp_returnstring = implode("&", $container);
} else {
$tmp_returnstring = "";
} }
return $tmp_returnstring; return $tmp_returnstring;
} }
@ -291,7 +294,7 @@ function tplGetContainerTypes($idlay, $container) {
global $db; global $db;
global $cfg; global $cfg;
global $containerinf; global $containerinf;
$list = array(); $list = array();
if (is_array($containerinf[$idlay])) { if (is_array($containerinf[$idlay])) {
@ -359,16 +362,14 @@ function tplPreparseLayout($idlay, $raw_code = NULL) {
if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) { if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) {
$idcontainer = $parser->iNodeAttributes["id"]; $idcontainer = $parser->iNodeAttributes["id"];
$mode = $parser->iNodeAttributes["mode"]; $sMode = (isset($parser->iNodeAttributes["mode"]))?$parser->iNodeAttributes["mode"]:'optional';
$sDefault = (isset($parser->iNodeAttributes["default"]))?$parser->iNodeAttributes["default"]:'';
if ($mode == "") { $sTypes = (isset($parser->iNodeAttributes["types"]))?$parser->iNodeAttributes["types"]:'';
$mode = "optional";
}
$containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"]; $containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"];
$containerinf[$idlay][$idcontainer]["mode"] = $mode; $containerinf[$idlay][$idcontainer]["mode"] = $sMode;
$containerinf[$idlay][$idcontainer]["default"] = $parser->iNodeAttributes["default"]; $containerinf[$idlay][$idcontainer]["default"] = $sDefault;
$containerinf[$idlay][$idcontainer]["types"] = $parser->iNodeAttributes["types"]; $containerinf[$idlay][$idcontainer]["types"] = $sTypes;
$containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody; $containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody;
} }
} }
@ -726,7 +727,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) { if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod"); $idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer FROM " . $cfg["tab"]["container"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'"; $sql = "SELECT idcontainer FROM " . $cfg["tab"]["container"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";
$db_autofill->query($sql); $db_autofill->query($sql);
@ -760,7 +760,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) { if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod"); $idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer, idmod FROM " . $cfg["tab"]["container"] $sql = "SELECT idcontainer, idmod FROM " . $cfg["tab"]["container"]
. " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'"; . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";

Datei anzeigen

@ -805,7 +805,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
$newfilename = ""; $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); $filename = str_replace(" ", $spacer, $filename);
} elseif (in_array(' ', $cfg['upl']['allow_additional_chars']) === FALSE) { } elseif (in_array(' ', $cfg['upl']['allow_additional_chars']) === FALSE) {
$filename = str_replace(" ", $spacer, $filename); $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) #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'])) { if (in_array($atom, $cfg['upl']['allow_additional_chars'])) {
$newfilename .= $atom; $newfilename .= $atom;
} }

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -111,6 +111,7 @@ $aManagedProperties = array(
); );
$aSettings = getSystemProperties(1); $aSettings = getSystemProperties(1);
$sNotification = '';
if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) { if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) {
$bStored = false; $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->setContent($notification->returnNotification("error", i18n('Access denied'), 1));
} }
$oPage->addScript('setMenu', $sJs); $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', 'system_mail_sender_name', 'pw_request_enable', 'maintenance_mode', 'edit_area_activated',
'backend_preferred_idclient', 'generator_basehref', 'generator_xhtml', 'imagemagick_available', 'backend_preferred_idclient', 'generator_basehref', 'generator_xhtml', 'imagemagick_available',
'system_insight_editing_activated'); 'system_insight_editing_activated');
$sWarning = '';
if ($action == "systemsettings_save_item") { if ($action == "systemsettings_save_item") {
if (!in_array($systype . '_' . $sysname, $aManagedValues)) { 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 $sql = "SELECT
a.idtpl, a.name as name, a.description, a.idlay, b.description as laydescription, a.defaulttemplate a.idtpl, a.name as name, a.description, a.idlay, b.description as laydescription, a.defaulttemplate
FROM FROM
" . $cfg['tab']['tpl'] . " AS a " . $cfg['tab']['tpl'] . " AS a
LEFT JOIN LEFT JOIN
" . $cfg['tab']['lay'] . " AS b " . $cfg['tab']['lay'] . " AS b
ON a.idlay=b.idlay ON a.idlay=b.idlay
WHERE a.idtpl='" . Contenido_Security::toInteger($idtpl) . "' WHERE a.idtpl='" . Contenido_Security::toInteger($idtpl) . "'
ORDER BY name"; ORDER BY name";
$db->query($sql); $db->query($sql);
@ -65,11 +65,11 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
} }
$sql = "SELECT $sql = "SELECT
number, idmod number, idmod
FROM FROM
" . $cfg['tab']['container'] . " " . $cfg['tab']['container'] . "
WHERE WHERE
idtpl='" . Contenido_Security::toInteger($idtpl) . "'"; idtpl='" . Contenido_Security::toInteger($idtpl) . "'";
$db->query($sql); $db->query($sql);
while ($db->next_record()) { while ($db->next_record()) {
@ -93,12 +93,12 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$tpl2->next(); $tpl2->next();
} }
$sql = "SELECT $sql = "SELECT
idlay, name idlay, name
FROM FROM
" . $cfg['tab']['lay'] . " " . $cfg['tab']['lay'] . "
WHERE WHERE
idclient='" . Contenido_Security::toInteger($client) . "' idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY name"; ORDER BY name";
$db->query($sql); $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); $select = $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
$sql = "SELECT $sql = "SELECT
idmod, name, type idmod, name, type
FROM FROM
" . $cfg['tab']['mod'] . " " . $cfg['tab']['mod'] . "
WHERE WHERE
idclient='" . Contenido_Security::toInteger($client) . "' idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY name"; ORDER BY name";
$db->query($sql); $db->query($sql);
@ -153,7 +153,6 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$descr = new cHTMLTextarea("description", $description); $descr = new cHTMLTextarea("description", $description);
$form->add(i18n("Description"), $descr->render()); $form->add(i18n("Description"), $descr->render());
$standardcb = new cHTMLCheckbox("vdefault", 1, "", $vdefault); $standardcb = new cHTMLCheckbox("vdefault", 1, "", $vdefault);
$form->add(i18n("Default"), $standardcb->toHTML(false)); $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(); $raw_code = ($oLayout->virgin) ? "" : $oLayout->getLayout();
tplPreparseLayout($idlay, $raw_code); tplPreparseLayout($idlay, $raw_code);
$tmp_returnstring = tplBrowseLayoutForContainers($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) { foreach ($a_container as $key => $value) {
if ($value != 0) { if ($value != 0) {
// Loop through containers **************** // Loop through containers ****************
@ -212,7 +217,7 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
} }
$allowedtypes = tplGetContainerTypes($idlay, $value); $allowedtypes = tplGetContainerTypes($idlay, $value);
foreach ($modules as $key => $val) { foreach ($modules as $key => $val) {
$option = new cHTMLOptionElement($val["name"], $key); $option = new cHTMLOptionElement($val["name"], $key);
@ -250,5 +255,4 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
} }
$page->render(); $page->render();
} }
?>

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