From a06b6f88a6f6af18fcec61d9ad508bf484089cc9 Mon Sep 17 00:00:00 2001 From: secretr Date: Fri, 25 Nov 2011 17:53:20 +0000 Subject: [PATCH] Minor fixes, added extended user category title support (same as fields behaviour) --- .../shortcodes/batch/signup_shortcodes.php | 12 ++++++------ e107_core/shortcodes/batch/user_shortcodes.php | 4 ++-- .../batch/usersettings_shortcodes.php | 17 ++++++++++------- e107_core/shortcodes/single/user_extended.sc | 8 +++++--- .../alt_auth/extended_password_handler.php | 4 ++-- e107_plugins/news/e_sitelink.php | 6 ++---- search.php | 11 +++++------ 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index a1825d99c..e5eba2d68 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -2,16 +2,14 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2011 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * - * $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/signup_shortcodes.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ // Mods to show extended field categories @@ -207,7 +205,9 @@ foreach($catList as $cat) { if(!$done_heading && ($cat['user_extended_struct_id'] > 0)) { // Add in a heading - $text .= str_replace('{EXTENDED_CAT_TEXT}', $tp->toHTML($cat['user_extended_struct_name'], FALSE, 'emotes_off,defs'), $SIGNUP_EXTENDED_CAT); + $catName = $cat['user_extended_struct_text'] ? $cat['user_extended_struct_text'] : $cat['user_extended_struct_name']; + if(defined($catName)) $catName = constant($catName); + $text .= str_replace('{EXTENDED_CAT_TEXT}', $tp->toHTML($catName, FALSE, 'emotes_off,defs'), $SIGNUP_EXTENDED_CAT); $done_heading = TRUE; } $replace = array( diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index 2bc11090e..aa53d4774 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -423,11 +423,11 @@ require_once(e_HANDLER."user_extended_class.php"); $ue = new e107_user_extended; $ueCatList = $ue->user_extended_get_categories(); $ueFieldList = $ue->user_extended_get_fields(); -$ueCatList[0][0] = array('user_extended_struct_name' => LAN_USER_44); +$ueCatList[0][0] = array('user_extended_struct_name' => LAN_USER_44, 'user_extended_struct_text' => ''); $ret = ""; foreach($ueCatList as $catnum => $cat) { - $key = $cat[0]['user_extended_struct_name']; + $key = $cat[0]['user_extended_struct_text'] ? $cat[0]['user_extended_struct_text'] : $cat[0]['user_extended_struct_name']; $cat_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$user['user_id']}}", TRUE); if($cat_name != FALSE && count($ueFieldList[$catnum])) { diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php index eecb8e716..d9d2ffa01 100755 --- a/e107_core/shortcodes/batch/usersettings_shortcodes.php +++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php @@ -2,16 +2,14 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2011 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * - * $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/usersettings_shortcodes.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ if (!defined('e107_INIT')) { exit; } @@ -271,7 +269,9 @@ if($catInfo) if($ret) { - $ret = str_replace("{CATNAME}", $catInfo['user_extended_struct_name'], $USER_EXTENDED_CAT).$ret; + $catName = $catInfo['user_extended_struct_text'] ? $catInfo['user_extended_struct_text'] : $catInfo['user_extended_struct_name']; + if(defined($catName)) $catName = constant($catName); + $ret = str_replace("{CATNAME}", $tp->toHTML($catName, FALSE, 'emotes_off,defs'), $USER_EXTENDED_CAT).$ret; } $extended_showed['cat'][$parm] = 1; @@ -303,7 +303,10 @@ if(!$fInfo) if($fInfo) { - $fname = $tp->toHTML($fInfo['user_extended_struct_text'], "", "emotes_off, defs"); + $fname = $fInfo['user_extended_struct_text']; + if(defined($fname)) $fname = constant($fname); + $fname = $tp->toHTML($fname, "", "emotes_off, defs"); + if($fInfo['user_extended_struct_required'] == 1) { $fname = str_replace("{FIELDNAME}", $fname, $REQUIRED_FIELD); diff --git a/e107_core/shortcodes/single/user_extended.sc b/e107_core/shortcodes/single/user_extended.sc index b9ee64778..5ff94c608 100644 --- a/e107_core/shortcodes/single/user_extended.sc +++ b/e107_core/shortcodes/single/user_extended.sc @@ -87,7 +87,7 @@ if ($parms[1] == 'text') } else { - return TRUE; + return FALSE; } } @@ -105,7 +105,8 @@ if ($parms[1] == 'icon') { return ""; } - return ''; + //return ''; + return FALSE; } if ($parms[1] == 'value') @@ -142,4 +143,5 @@ if ($parms[1] == 'value') } return FALSE; } -return TRUE; +// return TRUE; +return FALSE; \ No newline at end of file diff --git a/e107_plugins/alt_auth/extended_password_handler.php b/e107_plugins/alt_auth/extended_password_handler.php index f49c46ea5..bc6694b5a 100644 --- a/e107_plugins/alt_auth/extended_password_handler.php +++ b/e107_plugins/alt_auth/extended_password_handler.php @@ -238,13 +238,13 @@ class ExtendedPasswordHandler extends UserHandler break; case PASSWORD_JOOMLA_SALT : - case PASSWORD_MAMBO_SALT :var_dump($stored_hash, strlen($stored_hash)); + case PASSWORD_MAMBO_SALT : if ((strpos($stored_hash, ':') === false) || (strlen($stored_hash) < 40)) { return PASSWORD_INVALID; } // Mambo/Joomla salted hash - should be 32-character md5 hash, ':', 16-character salt (but could be 8-char salt, maybe) - list($hash, $salt) = explode(':', $stored_hash); var_dump($hash, $salt, md5($pword.$salt)); + list($hash, $salt) = explode(':', $stored_hash); $pwHash = md5($pword.$salt); $stored_hash = $hash; break; diff --git a/e107_plugins/news/e_sitelink.php b/e107_plugins/news/e_sitelink.php index 99db9d482..f52e74d77 100644 --- a/e107_plugins/news/e_sitelink.php +++ b/e107_plugins/news/e_sitelink.php @@ -8,10 +8,8 @@ * * Sitelinks configuration module - News * - * $Source: /cvs_backup/e107_0.8/e107_plugins/news/e_sitelink.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ * */ diff --git a/search.php b/search.php index d78816ed8..4ce3ceb3b 100644 --- a/search.php +++ b/search.php @@ -10,15 +10,14 @@ | Released under the terms and conditions of the | GNU General Public License (http://gnu.org). | -| $Source: /cvs_backup/e107_0.8/search.php,v $ -| $Revision$ -| $Date$ -| $Author$ +| $URL$ +| $Id$ +----------------------------------------------------------------------------+ */ require_once('class2.php'); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); +//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); +e107::coreLan('search'); if (!check_class($pref['search_restrict'])) { require_once(HEADERF); @@ -309,7 +308,7 @@ if ($search_prefs['selector'] == 1) $SEARCH_MAIN_SUBMIT = ""; -$ENHANCED_ICON = "".LAN_SEARCH_23.""; $enhanced_types['in'] = LAN_SEARCH_24.':';