From fa882c423c607e1b6ba933014e0f4cf705ebda16 Mon Sep 17 00:00:00 2001 From: Abdulrahman Date: Sat, 18 May 2019 20:55:28 +0300 Subject: [PATCH] new admin ban page --- admin/Masmak/admin_ban.html | 93 +++++++++++++++++++---- includes/adm/k_ban.php | 83 ++++++++++++++------- includes/functions.php | 32 +++++--- includes/style.php | 2 +- includes/usr.php | 143 +----------------------------------- lang/ar/acp.php | 10 +-- lang/ar/common.php | 2 +- lang/en/acp.php | 17 +---- lang/en/common.php | 2 +- ucp.php | 4 +- 10 files changed, 171 insertions(+), 217 deletions(-) diff --git a/admin/Masmak/admin_ban.html b/admin/Masmak/admin_ban.html index b6576a2..f512290 100755 --- a/admin/Masmak/admin_ban.html +++ b/admin/Masmak/admin_ban.html @@ -9,26 +9,87 @@
{lang.BAN_EXP1} -
- {lang.BAN_EXP2}
-
- -
- -
- - -
- -
- - + -{H_FORM_KEYS} -
+ + + + + + +
+ + + + + + + + + + + + + + + + + +
#{lang.IP} / {lang.USERNAME}
{{id}}{{content}} + + + +
+
+ + + + + diff --git a/includes/adm/k_ban.php b/includes/adm/k_ban.php index 05a9c1f..f79ff93 100755 --- a/includes/adm/k_ban.php +++ b/includes/adm/k_ban.php @@ -16,22 +16,20 @@ if (! defined('IN_ADMIN')) //for style .. $stylee = 'admin_ban'; -$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'); - -$affected = false; +$H_FORM_KEYS_GET = kleeja_add_form_key_get('adm_ban_get'); $H_FORM_KEYS = kleeja_add_form_key('adm_ban'); +$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'); +$delete_item = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&' . $H_FORM_KEYS_GET . '&case=del&k='; +$new_item_action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&case=new'; + + // // Check form key // -if (ip('submit')) -{ - if (! kleeja_check_form_key('adm_ban')) - { - kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1); - } -} +$case = g('case', 'str', 'view'); +$update_ban_content = false; $query = [ 'SELECT' => 'ban', @@ -40,35 +38,68 @@ $query = [ $result = $SQL->build($query); -$current_ban_data =$SQL->fetch_array($result); +$current_ban_data = $SQL->fetch_array($result); +$SQL->freeresult($result); -$ban = p('ban_text', 'str', $current_ban_data['ban']); +$banned_items = explode('|', $current_ban_data['ban']); -//when submit -if (ip('submit')) +$show_message = false; + +if($case == 'del' && ig('k')) { + if (! kleeja_check_form_key_get('adm_ban_get')) + { + header('HTTP/1.0 401 Unauthorized'); + kleeja_admin_err($lang['INVALID_GET_KEY'], $action); + } + + $to_delete = g('k'); + + $banned_items = array_filter($banned_items, function($item) use($to_delete, $lang, &$show_message) { + if(md5($item) == $to_delete) { + $show_message = sprintf($lang['ITEM_DELETED'], $item); + return false; + } + return true; + }); + + $update_ban_content = $show_message; +} + +if($case == 'new') +{ + if (! kleeja_check_form_key('adm_ban')) + { + kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1); + } + + $to_add = p('k', 'str', ''); + + if(! empty($to_add)) + { + $banned_items[] = $to_add; + $show_message = $lang['BAN_UPDATED']; + $update_ban_content = true; + } +} + +if($update_ban_content) +{ + $banned_items = array_filter($banned_items); //update $update_query = [ 'UPDATE' => "{$dbprefix}stats", - 'SET' => "ban='" . $SQL->escape($ban) . "'" + 'SET' => "ban='" . $SQL->escape(implode('|', $banned_items)) . "'" ]; $SQL->build($update_query); if ($SQL->affected()) { - $affected = true; delete_cache('data_ban'); } } - -$SQL->freeresult($result); - -//after submit -if (ip('submit')) -{ - $text = ($affected ? $lang['BAN_UPDATED'] : $lang['NO_UP_CHANGE_S']); - $text .= '' . "\n"; - $stylee = 'admin_info'; -} +array_walk($banned_items, function (&$value, &$key) { + $value = ['content' => $value, 'del_key' => md5($value), 'id' => $key+1]; +}); diff --git a/includes/functions.php b/includes/functions.php index 43085a7..8558958 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -68,28 +68,42 @@ function kleeja_detecting_bots() */ function get_ban() { - global $banss, $lang, $tpl, $text, $SQL; + global $banss, $lang, $SQL, $usrcp; //visitor ip now $ip = get_ip(); + $username = $usrcp->name(); //now .. loop for banned ips - if (is_array($banss) && ! empty($ip)) + if (is_array($banss) && (! empty($ip) || ! empty($username))) { - foreach ($banss as $ip2) + foreach ($banss as $banned_item) { - $ip2 = trim($ip2); + $banned_item = trim($banned_item); - if (empty($ip2)) + if (empty($banned_item)) { continue; } - //first .. replace all * with something good . - $replace_it = str_replace('*', '([0-9]{1,3})', $ip2); - $replace_it = str_replace('.', '\.', $replace_it); - if ($ip == $ip2 || @preg_match('/' . preg_quote($replace_it, '/') . '/i', $ip)) + $is_banned = false; + + //first .. replace all * with something good . + + if (! empty($ip) && strpos($banned_item, '.') !== false) + { + $replace_it = str_replace('*', '([0-9]{1,3})', $banned_item); + $replace_it = str_replace('.', '\.', $replace_it); + + $is_banned = $ip == $banned_item || @preg_match('/' . preg_quote($replace_it, '/') . '/i', $ip); + } + else if(! empty($username) && $banned_item == $username) + { + $is_banned = true; + } + + if ($is_banned) { is_array($plugin_run_result = Plugins::getInstance()->run('banned_get_ban_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook diff --git a/includes/style.php b/includes/style.php index 067fd7a..ce58ec8 100755 --- a/includes/style.php +++ b/includes/style.php @@ -257,7 +257,7 @@ class kleeja_style } $var = ! empty($matches[2]) ? str_replace('.', '\'][\'', $matches[2]) : ''; - return (! empty($matches[1]) && trim($matches[1]) == '{{') ? '$value[\'' . $var . '\']' : '$this->vars[\'' . $var . '\']'; + return ! empty($matches[1]) && trim($matches[1]) == '{{' ? '$value[\'' . $var . '\']' : '$this->vars[\'' . $var . '\']'; } /** diff --git a/includes/usr.php b/includes/usr.php index 1f91861..56ccd8b 100755 --- a/includes/usr.php +++ b/includes/usr.php @@ -248,7 +248,7 @@ class usrcp } // group ids - public function group_id () + public function group_id() { is_array($plugin_run_result = Plugins::getInstance()->run('group_id_func_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook @@ -256,7 +256,7 @@ class usrcp } // user name - public function name () + public function name() { is_array($plugin_run_result = Plugins::getInstance()->run('name_func_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook @@ -264,7 +264,7 @@ class usrcp } // user mail - public function mail () + public function mail() { is_array($plugin_run_result = Plugins::getInstance()->run('mail_func_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook @@ -446,7 +446,7 @@ class usrcp //return : mean return true or false, but if return is false will show msg public function kleeja_check_user() { - global $config, $SQL, $dbprefix, $userinfo; + global $config, $userinfo; is_array($plugin_run_result = Plugins::getInstance()->run('kleeja_check_user_func_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook @@ -509,139 +509,4 @@ class usrcp return false; //nothing } - - - // convert from utf8 to cp1256 and vice versa - public function kleeja_utf8($str, $to_utf8 = true) - { - $utf8 = new kleeja_utf8; - - if ($to_utf8) - { - //return iconv('CP1256', "UTF-8//IGNORE", $str); - return $utf8->to_utf8($str); - } - return $utf8->from_utf8($str); - //return iconv('UTF-8', "CP1256//IGNORE", $str); - } -}//end class - - -/** -* Deep modifieded by Kleeja team ... -* depend on class by Alexander Minkovsky (a_minkovsky@hotmail.com) -*/ -class kleeja_utf8 -{ - public $ascMap = []; - public $utfMap = []; - //ignore the untranslated char, of you put true we will translate it to html tags - //it's same the action of //IGNORE in iconv - public $ignore = false; - - //Constructor - public function __construct() - { - static $lines = []; - - if (empty($lines)) - { - $lines = explode("\n", preg_replace(['/#.*$/m', "/\n\n/"], '', file_get_contents(PATH . 'includes/CP1256.MAP'))); - } - - if (empty($this->ascMap)) - { - foreach ($lines as $line) - { - $parts = explode('0x', $line); - - if (sizeof($parts) == 3) - { - $this->ascMap[hexdec(trim($parts[1]))] = hexdec(trim($parts[2])); - } - } - $this->utfMap = array_flip($this->ascMap); - } - } - - //Translate string ($str) to UTF-8 from given charset - public function to_utf8($str) - { - $chars = unpack('C*', $str); - $cnt = sizeof($chars); - - for ($i=1;$i <= $cnt; ++$i) - { - $this->_charToUtf8($chars[$i]); - } - return implode('', $chars); - } - - //Translate UTF-8 string to single byte string in the given charset - public function from_utf8($utf) - { - $chars = unpack('C*', $utf); - $cnt = sizeof($chars); - $res = ''; //No simple way to do it in place... concatenate char by char - for ($i=1;$i<=$cnt;$i++) - { - $res .= $this->_utf8ToChar($chars, $i); - } - return $res; - } - - //Char to UTF-8 sequence - public function _charToUtf8(&$char) - { - $c = (int) $this->ascMap[$char]; - - if ($c < 0x80) - { - $char = chr($c); - } - elseif ($c<0x800) - { // 2 bytes - $char = (chr(0xC0 | $c>>6) . chr(0x80 | $c & 0x3F)); - } - elseif ($c<0x10000) - { // 3 bytes - $char = (chr(0xE0 | $c>>12) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F)); - } - elseif ($c<0x200000) - { // 4 bytes - $char = (chr(0xF0 | $c>>18) . chr(0x80 | $c>>12 & 0x3F) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F)); - } - } - - //UTF-8 sequence to single byte character - public function _utf8ToChar(&$chars, &$idx) - { - if (($chars[$idx] >= 240) && ($chars[$idx] <= 255)) - {// 4 bytes - $utf = (intval($chars[$idx]-240) << 18) + (intval($chars[++$idx]-128) << 12) + (intval($chars[++$idx]-128) << 6) + (intval($chars[++$idx]-128) << 0); - } - elseif (($chars[$idx] >= 224) && ($chars[$idx] <= 239)) - { // 3 bytes - $utf = (intval($chars[$idx]-224) << 12) + (intval($chars[++$idx]-128) << 6) + (intval($chars[++$idx]-128) << 0); - } - elseif (($chars[$idx] >= 192) && ($chars[$idx] <= 223)) - {// 2 bytes - $utf = (intval($chars[$idx]-192) << 6) + (intval($chars[++$idx]-128) << 0); - } - else - {// 1 byte - $utf = $chars[$idx]; - } - - if (array_key_exists($utf, $this->utfMap)) - { - return chr($this->utfMap[$utf]); - } - else - { - return $this->ignore ? '' : '&#' . $utf . ';'; - } - } } - -//<-- EOF diff --git a/lang/ar/acp.php b/lang/ar/acp.php index a2ac65c..3215cff 100755 --- a/lang/ar/acp.php +++ b/lang/ar/acp.php @@ -27,7 +27,6 @@ return [ 'GOOGLEANALYTICS' => 'Google Analytics', 'WELCOME_MSG' => 'كلمة الترحيب', 'USER_SYSTEM' => 'نظام العضوية (لاحظ: تغييرها قد يمنعك من الدخول مالم تتبع الشروحات)', - 'TOTAL_SIZE' => 'أقصى حجم كلي للمركز (ميقا بايت)', 'THUMBS_IMGS' => 'أبعاد مصغرات الصور (عرض x إرتفاع)', 'WRITE_IMGS' => 'تفعيل ختم الصور', @@ -48,7 +47,6 @@ return [ 'MOD_WRITER_EX' => 'روابط كـ HTML ..', 'NUMFIELD_S' => 'رجاءاً .. الحقول الرقمية .. يجب أن تكون رقمية!', 'CONFIGS_UPDATED' => 'تم تحديت الإعدادات بنجاح', - 'E_EXTS' => 'ملاحظة : الأحجام تضبط بالكليوبايت .', 'UPDATED_EXTS' => 'تم تحديث الإمتدادات بنجاح', 'EXT_DELETED' => 'تم حذف الامتداد بنجاح.', @@ -90,8 +88,8 @@ return [ 'R_REPAIR' => 'صيانة', 'R_LGOUTCP' => 'مسح جلسة الإدارة', 'R_BAN' => 'التحكم بالحظر', - 'BAN_EXP1' => 'قم بتحرير الآيبيات المحظورة وإضافة الجديد من هنا..', - 'BAN_EXP2' => 'إستخدم رمز النجمة (*)لاستبدال الارقام ..إذا كنت تريد الحظر الشامل ..وأستخدم الفاصل (|) للفصل بين الآيبيات', + 'BAN_EXP1' => 'تستطيع حظر مستخدمين/زوار عبر الأي بي أو اسم المستخدم الخاص بهم.', + 'BAN_EXP2' => 'لحظر مدى آيبيات استخدم النجمة (*) مثلاً: 116.10.191.*', 'UPDATE_BAN' => 'حفظ تعديلات الحظر', 'BAN_UPDATED' => 'تم تحديث قائمة الحظر بنجاح..', 'R_RULES' => 'شروط الخدمة', @@ -113,7 +111,6 @@ return [ 'EXTRA_UPDATED' => 'تم تحديث الإضافات القوالبية', 'R_STYLES' => 'الستايلات', 'NO_TPL_SHOOSED' => 'لم تقم بإختيار قالب!', - 'R_PLUGINS' => 'إضافات برمجية', 'ADD_NEW_PLUGIN' => 'أضف إضافة برمجية جديدة', 'ITEM_DELETED' => 'لقد تم حذف "%s" بنجاح...', @@ -139,7 +136,6 @@ return [ 'CONFIG_WRITEABLE' => 'ملف config.php قابل للكتابة حالياً ونوصي وبشدة تغيير التصريح له لـ 640 أو على الأقل 644.', 'USERS_NOT_NORMAL_SYS' => 'نظام العضويات الحالي ليس النظام العادي ، أي أن الأعضاء الحاليين لا يمكن تحريرهم من هنا بل من السكربت الذي تم ربط كليجا به، هؤلا الأعضاء يتبعون لنظام العضويات العادي.', 'DIMENSIONS_THMB' => 'أبعاد المصغرات', - 'ADMIN_DELETE_FILE_OK' => 'تم حذف كافة ملفات العضو', 'ADMIN_DELETE_FILES' => 'حذف كل ملفات العضوية', @@ -190,7 +186,6 @@ return [ 'USERSECTOUPLOAD' => 'عدد الثواني بين كل عملية رفع', 'ADM_UNWANTED_FILES' => 'يبدوا انك قمت بالترقية من نسخة سابقة وبسبب اختلاف اسماء بعض الملفات ستلاحظ وجود ازرار متكررة بلوحة التحكم .
لحل المشكلة قم بإزالة كافة الملفات في المسار "includes/adm" واعادة رفعها من جديد. ايضا قم بحذف ملف admin.php من المجلد الرئيسي اذا وجد.', 'HTML_URLS_ENABLED_NO_HTCC' => 'لقد قمت بتفعيل روابط الهتمل ولكنك نسيت أن تقوم بإعادة تسمية الملف htaccess.txt في مجلد كليجا الرئيسي ليصبح ".htaccess". اذا لم تفهم شيئاً من هذا الكلام قم بالسؤال في الدعم الفني لكليجا او قم بتعطيل روابط الهتمل .', - 'PLUGIN_CONFIRM_ADD' => 'انتبه, الاضافات هي تعديلات برمجية على كليجا و قد تكون ضارة أحياناً , لذا ان كنت غير متأكد من مصدر الإضافة ولم تقم بتحميلها من موقع كليجا فالافضل ان تراجع نفسك الآن . ', 'LOADING' => 'جاري التنفيذ', 'WELCOME' => 'مرحباً', @@ -254,7 +249,6 @@ return [ 'EXTRACT_ZIP_FAILED' => 'صادفتنا مشكلة أثناء فك الأرشيف! تأكد من أنه ملف zip صالح، وأن مجلد "%s" قابل للكتابة.', 'NO_PROBLEM_AFTER_ZIP' => 'لقد تم فك الملف بنجاح وهو جاهز للتفعيل.', 'SESSION_ENDED' => 'انتهت الجلسة، هل تريد تسجل الدخول من جديد؟', - //3.0.3 'CUSTOMIZATION' => 'تخصيص', 'SHOW' => 'عرض', 'HIDE' => 'إخفاء', diff --git a/lang/ar/common.php b/lang/ar/common.php index 4ac2e93..cc98b76 100755 --- a/lang/ar/common.php +++ b/lang/ar/common.php @@ -159,7 +159,7 @@ return [ 'URL_CANT_GET' => 'خطأ في جلب الملف من الرابط', 'ADMINCP' => 'مركز التحكم', 'GO_BACK_BROWSER' => 'رجوع للخلف', - 'U_R_BANNED' => 'لقد تم حظر الآي بي هذا..', + 'U_R_BANNED' => 'لقد تم حظر الآي بي/العضوية ..', 'U_R_FLOODER' => 'لقد قمت بتخطي عدد مرات عرض الصفحة بالوقت المحدد..', 'YES' => 'نعم', 'NO' => 'لا', diff --git a/lang/en/acp.php b/lang/en/acp.php index 85cf079..b3828aa 100755 --- a/lang/en/acp.php +++ b/lang/en/acp.php @@ -47,7 +47,6 @@ return [ 'DEL_F_DAY' => 'Auto Delete undownloaded files (days) (0 = disabled)', 'NUMFIELD_S' => 'You can only use numbers with some fields !!', 'CONFIGS_UPDATED' => 'Settings updated successfully.', - 'EXT_DELETED' => 'The extension deleted successfully.', 'E_EXTS' => 'Note : Sizes are measured in kilobytes.', 'UPDATED_EXTS' => 'Extensions updated successfully.', @@ -56,7 +55,6 @@ return [ 'U_REPORT_ON' => 'For your report about ', 'BY_EMAIL' => 'By email ', 'ADMIN_REPLIED' => 'Admin Reply', - 'IS_SEND_MAIL' => 'Reply has been sent.', 'REPORTS_UPDATED' => 'Reports have been updated.', 'REPLY_CALL' => 'Reply to this message', @@ -89,8 +87,8 @@ return [ 'R_REPAIR' => 'Maintenance', 'R_LGOUTCP' => 'Clear Session', 'R_BAN' => 'Ban Control', - 'BAN_EXP1' => 'Edit the banned IPs and add new ones here ..', - 'BAN_EXP2' => 'Use the star (*) symbol to replace numbers if you want a total ban.... and use the (|) to separate the IPs', + 'BAN_EXP1' => 'You can ban users/guests by their IPs or usernames.', + 'BAN_EXP2' => 'To block range of IPs, use star (*) symbol i.e. 116.10.191.*', 'UPDATE_BAN' => 'Save Changes', 'BAN_UPDATED' => 'Changes saved successfully.', 'R_RULES' => 'Terms', @@ -111,14 +109,10 @@ return [ 'UPDATE_EXTRA' => 'Update template', 'EXTRA_UPDATED' => 'Template additions updated successfully', 'R_STYLES' => 'Styles', - 'NO_TPL_SHOOSED' => 'You did not select a template!', - - 'R_PLUGINS' => 'Plugins', 'ADD_NEW_PLUGIN' => 'Add plugin', - - 'ITEM_DELETED' => '%s has been deleted successfully...', + 'ITEM_DELETED' => 'We have deleted "%s" successfully...', 'PLGUIN_DISABLED_ENABLED' => 'Plugin Enabled / Disabled', 'NO_PLUGINS' => 'No available plugins found...', 'NO_STYLES' => 'No available styles found...', @@ -131,9 +125,7 @@ return [ 'U_USE_PRE_RE' => 'You are using a Pre-release version, Click here to report any bugs or exploits.', 'STYLE_IS_DEFAULT' => 'Default style', 'MAKE_AS_DEFAULT' => 'Set as default', - 'STYLE_NOW_IS_DEFAULT' => 'The style "%s" was set as default', - 'UPDATE_NOW_S' => 'You are using an old version of Kleeja. Update Now. Your current version is %1$s and the latest one is %2$s', 'ADD_NEW_EXT' => 'Add a new extension', 'ADD_NEW_EXT_EXP' => 'Type a file extension to add it to this group (for example: doc)', @@ -203,7 +195,6 @@ return [ 'DELETE_PROCESS_IN_WORK' => 'Currently, the delete process is executing ...', 'SHOW_FROM_24H' => 'Show past 24 hours', 'THUMB_DIS_LONGTIME' => 'Thumbs are disabled, this will force Kleeja to resize every images to be small here, and cost you time and bandwidth!. Enable thumbs now.', - 'R_GROUPS' => 'Groups Management', 'ESSENTIAL_GROUPS' => 'Fundamental Groups', 'CUSTOM_GROUPS' => 'User-defined Groups', @@ -228,7 +219,6 @@ return [ 'DEFAULT_GROUP' => 'The default group', 'G_USERS_MOVE_TO' => 'Move the group users to', 'TAKEN_NAMES' => 'This name is taken. Choose another name', - 'GROUP_DELETED' => 'Group "%1$s" has been deleted and its user moved to group "%2$s".', 'NO_MOVE_SAME_GRP' => 'You can not move the users to the same group!.', 'DEFAULT_GRP_NO_DEL' => 'You can not delete this group becuase it is the current default group, change the default group then try to delete it!.', @@ -256,7 +246,6 @@ return [ 'EXTRACT_ZIP_FAILED' => 'We encounter a problem while extracting this archive file, make sure it\'s a valid zip file, and that "%s" folder is writable', 'NO_PROBLEM_AFTER_ZIP' => 'The file has been extracted successfully and it\'s ready to be enabled', 'SESSION_ENDED' => 'Session has ended, do you want to login again?', - //3.0.3 'CUSTOMIZATION' => 'Customization', 'SHOW' => 'Show', 'HIDE' => 'Hide', diff --git a/lang/en/common.php b/lang/en/common.php index 001117f..f050c6f 100755 --- a/lang/en/common.php +++ b/lang/en/common.php @@ -156,7 +156,7 @@ return [ 'ADMINCP' => 'Control Panel', 'GO_BACK_BROWSER' => 'Go back', - 'U_R_BANNED' => 'Your IP has been banned.', + 'U_R_BANNED' => 'Your IP/membership has been banned.', 'U_R_FLOODER' => 'it's anti-flood system ...', 'YES' => 'Yes', 'NO' => 'No', diff --git a/ucp.php b/ucp.php index c92fd1e..3223fd1 100755 --- a/ucp.php +++ b/ucp.php @@ -142,7 +142,7 @@ switch (g('go')) { if (isset($script_path)) { - $goto_forum_link = ($config['user_system'] == 'api') ? dirname($script_path) : $script_path; + $goto_forum_link = $config['user_system'] == 'api' ? dirname($script_path) : $script_path; if ($config['user_system'] == 'phpbb' || ($config['user_system'] == 'api' && strpos($script_path, 'phpbb') !== false)) { @@ -306,7 +306,7 @@ switch (g('go')) $H_FORM_KEYS = kleeja_add_form_key('fileuser'); $user_id_get = ig('id') ? g('id', 'int') : false; - $user_id = (! $user_id_get && $usrcp->id()) ? $usrcp->id() : $user_id_get; + $user_id = ! $user_id_get && $usrcp->id() ? $usrcp->id() : $user_id_get; $user_himself = $usrcp->id() == $user_id; $action = $config['siteurl'] . 'ucp.php?go=fileuser' . (ig('page') ? '&page=' . g('page', 'int') : '');