1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 05:37:32 +02:00

menumanager_class.php: fixed path for menu config action (it included '.php' and leaded to '.php.php' anding);

signup.php: added default empty values for user_class, user_perms, user_prefs, user_realm as they were leading to DB Insert error;
This commit is contained in:
berckoff
2012-01-10 16:31:39 +00:00
parent 771fc01a9c
commit 59f2feb30c
2 changed files with 151 additions and 152 deletions

View File

@@ -869,46 +869,46 @@ class e_menuManager {
$text .= "</select> $text .= "</select>
</div></form>"; </div></form>";
return $text; return $text;
} }
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function parseheader($LAYOUT, $check = FALSE) function parseheader($LAYOUT, $check = FALSE)
{ {
// $tmp = explode("\n", $LAYOUT); // $tmp = explode("\n", $LAYOUT);
// Split up using the same function as the shortcode handler // Split up using the same function as the shortcode handler
$tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); $tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$str = array(); $str = array();
for($c = 0; $c < count($tmp); $c++) for($c = 0; $c < count($tmp); $c++)
{ {
if(preg_match("/[\{|\}]/", $tmp[$c])) if(preg_match("/[\{|\}]/", $tmp[$c]))
{ {
if($check) if($check)
{ {
if(strstr($tmp[$c], "{MENU=")) if(strstr($tmp[$c], "{MENU="))
{ {
$matches = array(); $matches = array();
// Match all menu areas, menu number is limited to tinyint(3) // Match all menu areas, menu number is limited to tinyint(3)
preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $tmp[$c], $matches); preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $tmp[$c], $matches);
$this->menuSetCode($matches, $str); $this->menuSetCode($matches, $str);
} }
} }
else else
{ {
$this->checklayout($tmp[$c]); $this->checklayout($tmp[$c]);
} }
} }
else else
{ {
if(!$check) if(!$check)
{ {
echo $tmp[$c]; echo $tmp[$c];
} }
} }
} }
if($check) if($check)
{ {
return $str; return $str;
} }
} }
function menuSetCode($matches, &$ret) function menuSetCode($matches, &$ret)
@@ -922,121 +922,121 @@ class e_menuManager {
{ {
$ret[] = $match; $ret[] = $match;
} }
} }
function checklayout($str) function checklayout($str)
{ // Displays a basic representation of the theme { // Displays a basic representation of the theme
global $pref, $ns, $PLUGINS_DIRECTORY, $rs, $sc_style, $tp, $menu_order; global $pref, $ns, $PLUGINS_DIRECTORY, $rs, $sc_style, $tp, $menu_order;
$menuLayout = ($this->curLayout != $pref['sitetheme_deflayout']) ? $this->curLayout : ""; $menuLayout = ($this->curLayout != $pref['sitetheme_deflayout']) ? $this->curLayout : "";
if(strstr($str, "LOGO")) if(strstr($str, "LOGO"))
{ {
echo $tp->parseTemplate("{LOGO}"); echo $tp->parseTemplate("{LOGO}");
} }
else if(strstr($str, "SITENAME")) else if(strstr($str, "SITENAME"))
{ {
echo "<div style='padding: 2px'>[SiteName]</div>"; echo "<div style='padding: 2px'>[SiteName]</div>";
} }
else if(strstr($str, "SITETAG")) else if(strstr($str, "SITETAG"))
{ {
echo "<div style='padding: 2px'>[SiteTag]</div>"; echo "<div style='padding: 2px'>[SiteTag]</div>";
} }
else if(strstr($str, "SITELINKS")) else if(strstr($str, "SITELINKS"))
{ {
echo "<div style='padding: 2px; text-align: center'>[SiteLinks]</div>"; echo "<div style='padding: 2px; text-align: center'>[SiteLinks]</div>";
} }
else if(strstr($str, "LANGUAGELINKS")) else if(strstr($str, "LANGUAGELINKS"))
{ {
echo "<div class=text style='padding: 2px; text-align: center'>[Language]</div>"; echo "<div class=text style='padding: 2px; text-align: center'>[Language]</div>";
} }
else if(strstr($str, "CUSTOM")) else if(strstr($str, "CUSTOM"))
{ {
$cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str); $cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str);
echo "<div style='padding: 2px'>[" . $cust . "]</div>"; echo "<div style='padding: 2px'>[" . $cust . "]</div>";
} }
// Display embedded Plugin information. // Display embedded Plugin information.
else if(strstr($str, "PLUGIN")) else if(strstr($str, "PLUGIN"))
{ {
$plug = preg_replace("/\{PLUGIN=(.*?)\}/si", "\\1", $str); $plug = preg_replace("/\{PLUGIN=(.*?)\}/si", "\\1", $str);
$plug = trim($plug); $plug = trim($plug);
if(file_exists((e_PLUGIN . "{$plug}/{$plug}_config.php"))) if(file_exists((e_PLUGIN . "{$plug}/{$plug}_config.php")))
{ {
$link = e_PLUGIN . "{$plug}/{$plug}_config.php"; $link = e_PLUGIN . "{$plug}/{$plug}_config.php";
} }
if(file_exists((e_PLUGIN . $plug . "/config.php"))) if(file_exists((e_PLUGIN . $plug . "/config.php")))
{ {
$link = e_PLUGIN . $plug . "/config.php"; $link = e_PLUGIN . $plug . "/config.php";
} }
$plugtext = ($link) ? "(" . MENLAN_34 . ":<a href='$link' title='" . LAN_CONFIGURE . "'>" . LAN_CONFIGURE . "</a>)" : "(" . MENLAN_34 . ")"; $plugtext = ($link) ? "(" . MENLAN_34 . ":<a href='$link' title='" . LAN_CONFIGURE . "'>" . LAN_CONFIGURE . "</a>)" : "(" . MENLAN_34 . ")";
echo "<br />"; echo "<br />";
$ns->tablerender($plug, $plugtext); $ns->tablerender($plug, $plugtext);
} }
else if(strstr($str, "MENU")) else if(strstr($str, "MENU"))
{ {
$matches = array(); $matches = array();
if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $str, $matches)) if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $str, $matches))
{ {
foreach($matches[1] as $menu) foreach($matches[1] as $menu)
{ {
$menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str); $menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str);
if(isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) if(isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false)
{ {
echo $sc_style['MENU']['pre']; echo $sc_style['MENU']['pre'];
} }
echo " echo "
<div class='portal-column' id='portal-column-" . $menu . "'> <div class='portal-column' id='portal-column-" . $menu . "'>
<div style='text-align:center; font-size:14px' class='fborder'> <div style='text-align:center; font-size:14px' class='fborder'>
<div class='forumheader'><b>" . MENLAN_14 . " " . $menu . "</b></div></div><br />"; <div class='forumheader'><b>" . MENLAN_14 . " " . $menu . "</b></div></div><br />";
$text = "&nbsp;"; $text = "&nbsp;";
$sql9 = new db(); $sql9 = new db();
if($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '" . $this->dbLayout . "' ")) if($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '" . $this->dbLayout . "' "))
{ {
unset($text); unset($text);
echo $rs->form_open("post", e_SELF . "?configure=" . $this->curLayout, "frm_menu_" . intval($menu)); echo $rs->form_open("post", e_SELF . "?configure=" . $this->curLayout, "frm_menu_" . intval($menu));
$MODE = 1; $MODE = 1;
$sql9->db_Select("menus", "*", "menu_location='$menu' AND menu_layout='" . $this->dbLayout . "' ORDER BY menu_order"); $sql9->db_Select("menus", "*", "menu_location='$menu' AND menu_layout='" . $this->dbLayout . "' ORDER BY menu_order");
$menu_count = $sql9->db_Rows(); $menu_count = $sql9->db_Rows();
while($row = $sql9->db_Fetch(MYSQL_ASSOC)) while($row = $sql9->db_Fetch(MYSQL_ASSOC))
{ {
echo "\n\n\n <!-- Menu Start -->\n\n echo "\n\n\n <!-- Menu Start -->\n\n
<div class='block' id='block-" . $row['menu_id'] . "--" . $this->dbLayout . "'> <div class='block' id='block-" . $row['menu_id'] . "--" . $this->dbLayout . "'>
<div class='content'>"; <div class='content'>";
echo $this->menuRenderMenu($row, $menu_count); echo $this->menuRenderMenu($row, $menu_count);
echo "\n</div></div>"; echo "\n</div></div>";
echo "\n\n\n<!-- Menu end -->\n\n\n"; echo "\n\n\n<!-- Menu end -->\n\n\n";
echo "<div><br /></div>"; echo "<div><br /></div>";
} }
echo $rs->form_close(); echo $rs->form_close();
} }
echo "</div>"; echo "</div>";
if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false) if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false)
{ {
echo $sc_style['MENU']['post']; echo $sc_style['MENU']['post'];
} }
} }
} }
} }
else if(strstr($str, "SETSTYLE")) else if(strstr($str, "SETSTYLE"))
{ {
$tmp = explode("=", $str); $tmp = explode("=", $str);
$style = preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str); $style = preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str);
} }
else if(strstr($str, "SITEDISCLAIMER")) else if(strstr($str, "SITEDISCLAIMER"))
{ {
echo "[Sitedisclaimer]"; echo "[Sitedisclaimer]";
} }
} }
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
@@ -1060,7 +1060,7 @@ class e_menuManager {
$conf = ''; $conf = '';
if (file_exists(e_PLUGIN.$menu_path.$menu_name.'_menu_config.php')) if (file_exists(e_PLUGIN.$menu_path.$menu_name.'_menu_config.php'))
{ {
$conf = $menu_path.$menu_name.'_menu_config.php'; $conf = $menu_path.$menu_name.'_menu_config';
} }
if($conf == '' && file_exists(e_PLUGIN."{$menu_path}config.php")) if($conf == '' && file_exists(e_PLUGIN."{$menu_path}config.php"))
@@ -1187,7 +1187,6 @@ class e_menuManager {
} }
function menuSetConfigList() function menuSetConfigList()
{ {
global $sql,$pref; global $sql,$pref;
@@ -1226,13 +1225,5 @@ class e_menuManager {
$pref['menuconfig_list'] = $tmp; $pref['menuconfig_list'] = $tmp;
save_prefs(); save_prefs();
} }
} // end of Class.
} // end of Class.
?>

View File

@@ -513,7 +513,8 @@ if (isset($_POST['register']))
} }
// Work out data to be written to user audit trail // Work out data to be written to user audit trail
$signup_data = array('user_name', 'user_loginname', 'user_email', 'user_ip'); $signup_data = array('user_name', 'user_loginname', 'user_email', 'user_ip');
foreach (array() as $f) // foreach (array() as $f)
foreach ($signup_data as $f)
{ {
$signup_data[$f] = $allData['data'][$f]; // Just copy across selected fields $signup_data[$f] = $allData['data'][$f]; // Just copy across selected fields
} }
@@ -525,6 +526,13 @@ if (isset($_POST['register']))
} }
$allData['data']['user_join'] = time(); $allData['data']['user_join'] = time();
// The user_class, user_perms, user_prefs, user_realm fields don't have default value,
// so we put apropriate ones, otherwise - broken DB Insert
$allData['data']['user_class'] = '';
$allData['data']['user_perms'] = '';
$allData['data']['user_prefs'] = '';
$allData['data']['user_realm'] = '';
// Actually write data to DB // Actually write data to DB
validatorClass::addFieldTypes($userMethods->userVettingInfo,$allData); validatorClass::addFieldTypes($userMethods->userVettingInfo,$allData);