This commit is contained in:
Abdulrahman
2019-05-24 04:28:18 +03:00
parent d9155f915c
commit bd1c425a6f
5 changed files with 23 additions and 70 deletions

View File

@@ -26,7 +26,7 @@ $action_all = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php')
$cp_users_url = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'); $cp_users_url = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php');
//if not normal user system //if not normal user system
$user_not_normal = (int) $config['user_system'] != 1 ? true : false; $user_not_normal = (int) $config['user_system'] != 1;
$is_search = $affected = false; $is_search = $affected = false;
$GET_FORM_KEY = kleeja_add_form_key_get('adm_users'); $GET_FORM_KEY = kleeja_add_form_key_get('adm_users');
$H_FORM_KEYS = kleeja_add_form_key('adm_users'); $H_FORM_KEYS = kleeja_add_form_key('adm_users');

View File

@@ -20,7 +20,7 @@ $stylee = 'admin_search';
$action = basename(ADMIN_PATH) . '?cp=h_search'; $action = basename(ADMIN_PATH) . '?cp=h_search';
//wut the default user system //wut the default user system
$default_user_system = (int) $config['user_system'] == 1 ? true : false; $default_user_system = (int) $config['user_system'] == 1;
$H_FORM_KEYS = kleeja_add_form_key('adm_files_search'); $H_FORM_KEYS = kleeja_add_form_key('adm_files_search');
$H_FORM_KEYS2 = kleeja_add_form_key('adm_users_search'); $H_FORM_KEYS2 = kleeja_add_form_key('adm_users_search');

View File

@@ -33,10 +33,6 @@ if (@extension_loaded('apc'))
//path //path
if (! defined('PATH')) if (! defined('PATH'))
{ {
if (! defined('__DIR__'))
{
define('__DIR__', dirname(__FILE__));
}
define('PATH', str_replace('/includes', '', __DIR__) . '/'); define('PATH', str_replace('/includes', '', __DIR__) . '/');
} }

View File

@@ -268,7 +268,7 @@ function kleeja_debug()
$debug_output = ''; $debug_output = '';
//get memory usage ; code of phpbb //get memory usage
if (function_exists('memory_get_usage')) if (function_exists('memory_get_usage'))
{ {
if ($memory_usage = memory_get_usage()) if ($memory_usage = memory_get_usage())

83
ucp.php
View File

@@ -35,7 +35,7 @@ switch (g('go'))
$stylee = 'login'; $stylee = 'login';
$titlee = $lang['LOGIN']; $titlee = $lang['LOGIN'];
$action = 'ucp.php?go=login' . (ig('return') ? '&return=' . g('return') : ''); $action = 'ucp.php?go=login' . (ig('return') ? '&return=' . g('return') : '');
$forget_pass_link = ! empty($forgetpass_script_path) && (int) $config['user_system'] != 1 ? $forgetpass_script_path : 'ucp.php?go=get_pass'; $forget_pass_link = 'ucp.php?go=get_pass';
$H_FORM_KEYS = kleeja_add_form_key('login'); $H_FORM_KEYS = kleeja_add_form_key('login');
//no error yet //no error yet
$ERRORS = false; $ERRORS = false;
@@ -132,33 +132,9 @@ switch (g('go'))
} }
elseif ($config['user_system'] != '1') elseif ($config['user_system'] != '1')
{ {
$goto_forum_link = '...';
is_array($plugin_run_result = Plugins::getInstance()->run('register_not_default_sys', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook is_array($plugin_run_result = Plugins::getInstance()->run('register_not_default_sys', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
if (! empty($register_script_path))
{
$goto_forum_link = $register_script_path;
}
else
{
if (isset($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))
{
$goto_forum_link .= '/ucp.php?mode=register';
}
elseif ($config['user_system'] == 'vb' || ($config['user_system'] == 'api' && strpos($script_path, 'vb') !== false))
{
$goto_forum_link .= '/register.php';
}
}
else
{
$goto_forum_link = '...';
}
}
kleeja_info('<a href="' . $goto_forum_link . '" title="' . $lang['REGISTER'] . '" target="_blank">' . $lang['REGISTER'] . '</a>', $lang['REGISTER']); kleeja_info('<a href="' . $goto_forum_link . '" title="' . $lang['REGISTER'] . '" target="_blank">' . $lang['REGISTER'] . '</a>', $lang['REGISTER']);
} }
@@ -316,19 +292,19 @@ switch (g('go'))
kleeja_err($lang['USER_PLACE'], $lang['PLACE_NO_YOU'], true, 'index.php'); kleeja_err($lang['USER_PLACE'], $lang['PLACE_NO_YOU'], true, 'index.php');
} }
//Not allowed to browse files's folders of other users //Not allowed to browse files's folders of other users
if (! user_can('access_fileusers') && ! $user_himself) if (! user_can('access_fileusers') && ! $user_himself)
{ {
is_array($plugin_run_result = Plugins::getInstance()->run('user_cannot_access_fileusers', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook is_array($plugin_run_result = Plugins::getInstance()->run('user_cannot_access_fileusers', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
kleeja_info($lang['HV_NOT_PRVLG_ACCESS'], $lang['HV_NOT_PRVLG_ACCESS']); kleeja_info($lang['HV_NOT_PRVLG_ACCESS'], $lang['HV_NOT_PRVLG_ACCESS']);
} }
//Not allowed to access this page ? //Not allowed to access this page ?
if (! user_can('access_fileuser') && $user_himself) if (! user_can('access_fileuser') && $user_himself)
{ {
is_array($plugin_run_result = Plugins::getInstance()->run('user_cannot_access_fileuser', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook is_array($plugin_run_result = Plugins::getInstance()->run('user_cannot_access_fileuser', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
kleeja_info($lang['HV_NOT_PRVLG_ACCESS'], $lang['HV_NOT_PRVLG_ACCESS']); kleeja_info($lang['HV_NOT_PRVLG_ACCESS'], $lang['HV_NOT_PRVLG_ACCESS']);
} }
//fileuser is closed ? //fileuser is closed ?
if ((int) $config['enable_userfile'] != 1 && ! user_can('enter_acp')) if ((int) $config['enable_userfile'] != 1 && ! user_can('enter_acp'))
@@ -336,10 +312,10 @@ switch (g('go'))
kleeja_info($lang['USERFILE_CLOSED'], $lang['CLOSED_FEATURE']); kleeja_info($lang['USERFILE_CLOSED'], $lang['CLOSED_FEATURE']);
} }
//get user options and name //get user options and name
$data_user = $config['user_system'] == 1 ? $usrcp->get_data('name, show_my_filecp', $user_id) : ['name' => $usrcp->usernamebyid($user_id), 'show_my_filecp' => '1']; $data_user = $config['user_system'] == 1 ? $usrcp->get_data('name, show_my_filecp', $user_id) : ['name' => $usrcp->usernamebyid($user_id), 'show_my_filecp' => '1'];
//if there is no username, then there is no user at all //if there is no username, then there is no user at all
if (! $data_user['name']) if (! $data_user['name'])
{ {
kleeja_err($lang['NOT_EXSIT_USER'], $lang['PLACE_NO_YOU']); kleeja_err($lang['NOT_EXSIT_USER'], $lang['PLACE_NO_YOU']);
@@ -382,6 +358,7 @@ switch (g('go'))
{ {
$data_user['name'] = $usrcp->usernamebyid($user_id); $data_user['name'] = $usrcp->usernamebyid($user_id);
} }
$user_name = ! $data_user['name'] ? false : $data_user['name']; $user_name = ! $data_user['name'] ? false : $data_user['name'];
//set page title //set page title
@@ -604,36 +581,13 @@ switch (g('go'))
$name = $usrcp->name(); $name = $usrcp->name();
$mail = $usrcp->mail(); $mail = $usrcp->mail();
extract($usrcp->get_data('show_my_filecp, password_salt')); extract($usrcp->get_data('show_my_filecp, password_salt'));
$data_forum = (int) $config['user_system'] == 1 ? true : false; $data_forum = (int) $config['user_system'] == 1;
$link_avater = sprintf($lang['EDIT_U_AVATER_LINK'], '<a target="_blank" href="http://www.gravatar.com/">', '</a>'); $link_avater = sprintf($lang['EDIT_U_AVATER_LINK'], '<a target="_blank" href="http://www.gravatar.com/">', '</a>');
$H_FORM_KEYS = kleeja_add_form_key('profile'); $H_FORM_KEYS = kleeja_add_form_key('profile');
//no error yet //no error yet
$ERRORS = false; $ERRORS = false;
if (! empty($profile_script_path)) $goto_forum_link = '...';
{
$goto_forum_link = $profile_script_path;
}
else
{
if (isset($script_path))
{
$goto_forum_link = ($config['user_system'] == 'api') ? dirname($script_path) : $script_path;
if ($config['user_system'] == 'phpbb' || ($config['user_system'] == 'api' && strpos(strtolower($script_path), 'phpbb') !== false))
{
$goto_forum_link .= '/ucp.php?i=164';
}
elseif ($config['user_system'] == 'vb' || ($config['user_system'] == 'api' && strpos(strtolower($script_path), 'vb') !== false))
{
$goto_forum_link .= '/profile.php?do=editprofile';
}
}
else
{
$goto_forum_link = '...';
}
}
//_post //_post
$t_pppass_old = p('pppass_old'); $t_pppass_old = p('pppass_old');
@@ -641,7 +595,7 @@ switch (g('go'))
$t_ppass_new = p('ppass_new'); $t_ppass_new = p('ppass_new');
$t_ppass_new2 = p('ppass_new2'); $t_ppass_new2 = p('ppass_new2');
is_array($plugin_run_result = Plugins::getInstance()->run('no_submit_profile', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook is_array($plugin_run_result = Plugins::getInstance()->run('no_submit_profile', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
// //
// after submit // after submit
@@ -742,7 +696,10 @@ switch (g('go'))
//if not default system, let's give him a link for integrated script //if not default system, let's give him a link for integrated script
if ((int) $config['user_system'] != 1) if ((int) $config['user_system'] != 1)
{ {
$text = '<a href="' . (! empty($forgetpass_script_path) ? $forgetpass_script_path : $script_path) . '">' . $lang['LOST_PASS_FORUM'] . '</a>'; $forgetpass_link = '...';
is_array($plugin_run_result = Plugins::getInstance()->run('get_pass_resetpass_link', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
$text = '<a href="' . $forgetpass_link . '">' . $lang['LOST_PASS_FORUM'] . '</a>';
kleeja_info($text, $lang['PLACE_NO_YOU']); kleeja_info($text, $lang['PLACE_NO_YOU']);
} }