Moved the Agents into their own repo. Kept the agent.pl just for reference
This commit is contained in:
parent
22381be29a
commit
8680a02b13
18132 changed files with 0 additions and 2569420 deletions
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
global $view;
|
||||
|
||||
if( isset($_POST['add_group']) )
|
||||
{
|
||||
$group = sanitizeInputStr($_POST['group_name']);
|
||||
|
||||
if (empty($group))
|
||||
{
|
||||
print_failure(get_lang('group_name_empty'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !$db->addGroup($group,$_SESSION['user_id']) )
|
||||
{
|
||||
print_failure(get_lang_f("failed_to_add_group",$group));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
return;
|
||||
}
|
||||
|
||||
print_success(get_lang_f('successfully_added_group',$group));
|
||||
$db->logger(get_lang_f('successfully_added_group',$group));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
global $view;
|
||||
|
||||
$group_id = $_REQUEST['group_id'];
|
||||
|
||||
if ( !$db->isAdmin($_SESSION['user_id']) )
|
||||
{
|
||||
$result = $db->getUserGroupList($_SESSION['user_id']);
|
||||
foreach ( $result as $row ) #loop through the groups
|
||||
{
|
||||
if ( $row['group_id'] == $group_id )
|
||||
{
|
||||
$own_group = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$db->isAdmin($_SESSION['user_id']) && !isset($own_group))
|
||||
{
|
||||
echo "<p class='note'>".get_lang('not_available')."</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
if( isset($_POST['add_user_to_group']) )
|
||||
{
|
||||
$group_id = trim($_POST['group_id']);
|
||||
$user_id = trim($_POST['user_to_add']);
|
||||
$user = $db->getUserById($user_id);
|
||||
$group = $db->getGroupById($group_id);
|
||||
if ( $group['main_user_id'] == $user_id or !$db->addUsertoGroup($user_id,$group_id))
|
||||
{
|
||||
print_failure(get_lang_f('could_not_add_user_to_group', $user['users_login'], $group['group_name']));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
return;
|
||||
}
|
||||
|
||||
echo "<p class='success'>".get_lang_f('successfully_added_to_group', $user['users_login'], $group['group_name'])."</p>";
|
||||
$db->logger(get_lang_f('successfully_added_to_group', $user['users_login'], $group['group_name']));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
global $view;
|
||||
if( isset($_POST['submit']) )
|
||||
{
|
||||
$username = sanitizeInputStr($_POST['username']);
|
||||
$user_role = trim($_POST['user_role']);
|
||||
$password = trim($_POST['newpass']);
|
||||
$password2 = trim($_POST['newpass2']);
|
||||
|
||||
// Check a username is actually entered...
|
||||
if(empty($username) === true){
|
||||
print_failure(get_lang('enter_valid_username'));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check _POST['user_role'] is what we expect it to be: either user or admin.
|
||||
// Without this it can be anything else. It's pointless being anything else - but why allow it to be anything else?
|
||||
if(in_array($_POST['user_role'], array('user', 'admin')) === false){
|
||||
print_failure(get_lang('unexpected_role'));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
if( empty($password) || empty($password2) )
|
||||
{
|
||||
print_failure(get_lang('you_need_to_enter_both_passwords'));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
if($password !== $password2)
|
||||
{
|
||||
print_failure(get_lang('passwords_did_not_match'));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !$db->addUser($username,$password,$user_role) )
|
||||
{
|
||||
print_failure(get_lang_f('could_not_add_user_because_user_already_exists', $username));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
print_success(get_lang_f('successfully_added_user', $username));
|
||||
$db->logger(get_lang_f('successfully_added_user', $username));
|
||||
$view->refresh("?m=user_admin");
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<div class="center">
|
||||
<h2><?php print_lang('add_a_new_user'); ?></h2>
|
||||
<form action="?m=user_admin&p=add" method="post">
|
||||
<table class="center">
|
||||
<tr><td align='right'><label for='username'><?php print_lang('username'); ?>:</label></td><td><input id="username" type="text" name="username" value="" /></td></tr>
|
||||
<tr><td align='right'><?php print_lang('user_role'); ?>:</td><td align='left'>
|
||||
<select name='user_role'>
|
||||
<option value="admin"><?php print_lang('admin'); ?></option>
|
||||
<option value="user" selected="selected"><?php print_lang('user'); ?></option></select></td></tr>
|
||||
<tr><td align='right'><label for='password'><?php print_lang('password'); ?>:</label></td><td><input id="password" type="password" name="newpass" value="" /></td></tr>
|
||||
<tr><td align='right'><label for='confirm_password'><?php print_lang('confirm_password'); ?>:</label></td>
|
||||
<td><input id="confirm_password" type="password" name="newpass2" value="" /></td></tr>
|
||||
</table>
|
||||
<p><input type="submit" name="submit" value="<?php print_lang('add_user'); ?>" /></p>
|
||||
</form>
|
||||
</div><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
global $view;
|
||||
|
||||
$group_id = $_GET['group_id'];
|
||||
|
||||
if ( !$db->isAdmin($_SESSION['user_id']) )
|
||||
{
|
||||
$result = $db->getUserGroupList($_SESSION['user_id']);
|
||||
foreach ( $result as $row ) #loop through the groups
|
||||
{
|
||||
if ( $row['group_id'] == $group_id )
|
||||
{
|
||||
$own_group = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$db->isAdmin($_SESSION['user_id']) && !isset($own_group))
|
||||
{
|
||||
echo "<p class='note'>".get_lang('not_available')."</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete user from group.
|
||||
if( isset($_GET['group_id']) && isset($_GET['user_id']) )
|
||||
{
|
||||
$group_id = trim($_GET['group_id']);
|
||||
$user_id = trim($_GET['user_id']);
|
||||
|
||||
if ( !$db->delUserFromGroup($user_id, $group_id))
|
||||
{
|
||||
print_failure(get_lang_f('could_not_delete_user_from_group', $user_id, $group_id));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
echo "<p class='success'>".get_lang_f('successfully_removed_from_group', $user_id, $group_id)."</p>";
|
||||
$db->logger(get_lang_f('successfully_removed_from_group', $user_id, $group_id));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
global $view;
|
||||
|
||||
$group_id = $_GET['group_id'];
|
||||
|
||||
if ( !$db->isAdmin($_SESSION['user_id']) )
|
||||
{
|
||||
$result = $db->getUserGroupList($_SESSION['user_id']);
|
||||
foreach ( $result as $row ) #loop through the groups
|
||||
{
|
||||
if ( $row['group_id'] == $group_id )
|
||||
{
|
||||
$own_group = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$db->isAdmin($_SESSION['user_id']) && !isset($own_group))
|
||||
{
|
||||
echo "<p class='note'>".get_lang('not_available')."</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
$y = isset($_GET['y']) ? $_GET['y'] : "";
|
||||
|
||||
$group = $db->getGroupById($group_id);
|
||||
|
||||
if ( empty($group) )
|
||||
{
|
||||
print_failure(get_lang_f('group_with_id_does_not_exist', $group_id));
|
||||
return;
|
||||
}
|
||||
|
||||
$groupname = $group['group_name'];
|
||||
|
||||
if($y !== 'y')
|
||||
{
|
||||
echo "<p>".get_lang_f('are_you_sure_you_want_to_delete_group', $groupname)."</p>";
|
||||
echo "<p><a href=\"?m=user_admin&p=del_group&group_id=$group_id&y=y\">".
|
||||
get_lang('yes')."</a> <a href=\"?m=user_admin&p=show_groups\">".
|
||||
get_lang('no')."</a></p>";
|
||||
return;
|
||||
}
|
||||
|
||||
if( !$db->delGroup($group_id) )
|
||||
{
|
||||
print_failure(get_lang_f('unable_to_delete_group', $groupname));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
return;
|
||||
}
|
||||
|
||||
print_success(get_lang_f('successfully_deleted_group', $groupname));
|
||||
$db->logger(get_lang_f('successfully_deleted_group', $groupname));
|
||||
$view->refresh("?m=user_admin&p=show_groups");
|
||||
};
|
||||
?>
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
global $view;
|
||||
|
||||
$user_id = $_GET['user_id'];
|
||||
$y = isset($_GET['y']) ? $_GET['y'] : "";
|
||||
|
||||
$user = $db->getUserById($user_id);
|
||||
|
||||
if ( empty($user) )
|
||||
{
|
||||
print_failure(get_lang_f('user_with_id_does_not_exist', $user_id));
|
||||
return;
|
||||
}
|
||||
|
||||
$username = $user['users_login'];
|
||||
|
||||
if($y !== 'y')
|
||||
{
|
||||
if(!$db->isModuleInstalled("subusers")){
|
||||
echo "<p>".get_lang_f('are_you_sure_you_want_to_delete_user', $username)."</p>";
|
||||
}else{
|
||||
if(!$db->isSubUser($user_id)){
|
||||
echo "<p>".get_lang_f('are_you_sure_you_want_to_delete_user', $username) . get_lang('andSubUsers') . "</p>";
|
||||
}else{
|
||||
echo "<p>".get_lang_f('are_you_sure_you_want_to_delete_user', $username)."</p>";
|
||||
}
|
||||
}
|
||||
echo "<p><a href=\"?m=user_admin&p=del&user_id=$user_id&y=y\">".
|
||||
get_lang('yes')."</a> <a href=\"?m=user_admin\">".
|
||||
get_lang('no')."</a></p>";
|
||||
return;
|
||||
}
|
||||
|
||||
if( !$db->delUser($user_id) )
|
||||
{
|
||||
print_failure(get_lang_f('unable_to_delete_user', $username));
|
||||
$view->refresh("?m=user_admin");
|
||||
return;
|
||||
}
|
||||
|
||||
print_success(get_lang_f('successfully_deleted_user', $username));
|
||||
$db->logger(get_lang_f('successfully_deleted_user', $username));
|
||||
$view->refresh("?m=user_admin");
|
||||
};
|
||||
?>
|
||||
|
|
@ -1,324 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module() {
|
||||
global $db, $settings;
|
||||
|
||||
// Check if the user_id is set in the uri first. Prevents notices if it's been removed.
|
||||
if(!isset($_REQUEST['user_id']) === true){
|
||||
print_failure(get_lang('valid_user'));
|
||||
return;
|
||||
}
|
||||
|
||||
$my_user_id = $_SESSION['user_id']; #who we're logged in as
|
||||
$user_id = $_REQUEST['user_id'];
|
||||
$isAdmin = $db->isAdmin($my_user_id);
|
||||
$mySubUsers = $db->getUsersSubUsersIds($_SESSION['user_id']);
|
||||
|
||||
// Check that the user_id parameter corresponds to a valid user.
|
||||
if(($userInfo = $db->getUserById($user_id)) === null)
|
||||
{
|
||||
print_failure(get_lang('valid_user'));
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow user to modify owned subuser account information
|
||||
else if ( ! $isAdmin && $my_user_id !== $user_id && @!in_array($user_id, $mySubUsers))
|
||||
{
|
||||
print_failure(get_lang('no_rights'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $isAdmin )
|
||||
{
|
||||
$users = $db->getUserList();
|
||||
foreach ( $users as $user )
|
||||
{
|
||||
if ( $db->isAdmin($user['user_id']) )
|
||||
{
|
||||
$first_admin_id = $user['user_id'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( $db->isAdmin($user_id) and ( $first_admin_id != $my_user_id ) and ( $user_id != $my_user_id ) )
|
||||
{
|
||||
print_failure(get_lang('no_rights'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
echo "<h2>".($my_user_id !== $user_id ? get_lang_f('editing_profile', htmlentities($userInfo['users_login'])) : get_lang('your_profile'))."</h2>";
|
||||
echo "<div align='center'>";
|
||||
require_once("includes/form_table_class.php");
|
||||
|
||||
if ( ( isset($_POST['new_password']) || isset($_POST['retype_new_password']) ) &&
|
||||
$_POST['new_password'] !== $_POST['retype_new_password'] )
|
||||
{
|
||||
print_failure(get_lang('password_mismatch'));
|
||||
}
|
||||
# If we are editing our own profile we need to enter our current password as well
|
||||
# elseif (isset($_POST['edit_user']) &&
|
||||
# ($my_user_id === $user_id) &&
|
||||
# !$db->is_valid_login($my_user_id,$_REQUEST['current_password']))
|
||||
#{
|
||||
# print_failure(get_lang('current_password_mismatch'));
|
||||
#}
|
||||
else if (isset($_POST['edit_user']))
|
||||
{
|
||||
$user_id = sanitizeInputStr($_POST['user_id']);
|
||||
$newlang = sanitizeInputStr($_POST['newlang']);
|
||||
$login = sanitizeInputStr($_POST['login']);
|
||||
$firstname = sanitizeInputStr($_POST['first_name']);
|
||||
$lastname = sanitizeInputStr($_POST['last_name']);
|
||||
$email = sanitizeInputStr($_POST['email_address']);
|
||||
$city = sanitizeInputStr($_POST['city']);
|
||||
$province = sanitizeInputStr($_POST['province']);
|
||||
$country = sanitizeInputStr($_POST['country']);
|
||||
$phone = sanitizeInputStr($_POST['phone_number']);
|
||||
$phone = preg_replace("/[^0-9]/", "", $phone);
|
||||
$theme = sanitizeInputStr($_POST['theme']);
|
||||
$page_limit = sanitizeInputStr($_POST['page_limit']);
|
||||
|
||||
// OGP needs to set the new theme and language in the current session, only if I'm modifying my own user profile.
|
||||
if ( $my_user_id == $user_id )
|
||||
{
|
||||
$_SESSION['users_theme'] = $theme;
|
||||
$_SESSION['users_lang'] = $newlang;
|
||||
}
|
||||
|
||||
$fields['users_lang'] = $newlang;
|
||||
$fields['users_fname'] = $firstname;
|
||||
$fields['users_lname'] = $lastname;
|
||||
$fields['users_phone'] = $phone;
|
||||
$fields['users_city'] = $city;
|
||||
$fields['users_province'] = $province;
|
||||
$fields['users_country'] = $country;
|
||||
|
||||
if( isset($settings['editable_email']) )
|
||||
{
|
||||
if( $settings['editable_email'] == "1" OR ( $settings['editable_email'] == "0" and $isAdmin ) )
|
||||
$fields['users_email'] = $email;
|
||||
}
|
||||
elseif( !isset( $settings['editable_email'] ) )
|
||||
{
|
||||
$fields['users_email'] = $email;
|
||||
}
|
||||
|
||||
if ( $isAdmin )
|
||||
{
|
||||
$mins = sanitizeInputStr($_POST['minutes']);
|
||||
$hours = sanitizeInputStr($_POST['hours']);
|
||||
$months = sanitizeInputStr($_POST['month']);
|
||||
$days = sanitizeInputStr($_POST['days']);
|
||||
$years = sanitizeInputStr($_POST['years']);
|
||||
|
||||
if($months == 'X' || $days == 'X' || $years == 'X' || $hours == 'X' || $mins == 'X')
|
||||
$expire_timestamp = "X";
|
||||
else
|
||||
$expire_timestamp = mktime( $hours, $mins, 0, $months, $days, $years);
|
||||
|
||||
$fields['users_role'] = sanitizeInputStr($_POST['newrole']);
|
||||
$fields['users_comment'] = sanitizeInputStr($_POST['comment']);
|
||||
$fields['user_expires'] = $expire_timestamp;
|
||||
$fields['users_login'] = $login;
|
||||
|
||||
// Handle email preference
|
||||
if(isset($_POST['user_receives_emails']) && is_numeric($_POST['user_receives_emails'])){
|
||||
$fields['user_receives_emails'] = sanitizeInputStr($_POST['user_receives_emails']);
|
||||
}
|
||||
}
|
||||
|
||||
//when someone changes the profile to admin
|
||||
if (isset($userInfo['users_role']) && isset($_POST['newrole']) && $userInfo['users_role'] != $_POST['newrole']) {
|
||||
$client_ip = getClientIPAddress();
|
||||
//WEBHOOK Discord=======================================================================================
|
||||
// Create new webhook in your Discord channel settings and copy&paste URL
|
||||
//=======================================================================================================
|
||||
$webhookurl = "https://discord.com/api/webhooks/1087810639390576650/sspI3frko8FLD6ybvzG-_BXhG4wjH7yujFBxffgtTw34uAL_AdrDxY36C-khqs--cEMu";
|
||||
//========================================================================================================
|
||||
$msg = "User Role Changed :warning: \nIP: ".$client_ip." \nUser: ".$login." \nUser Role: ".$userInfo['users_role']." \nNew Role: ".$_POST['newrole'];
|
||||
$json_data = array ('content'=>"$msg");
|
||||
$make_json = json_encode($json_data);
|
||||
$ch = curl_init( $webhookurl );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
||||
curl_setopt( $ch, CURLOPT_POST, 1);
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
|
||||
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec( $ch );
|
||||
//end WEBHOOK Discord
|
||||
}
|
||||
|
||||
if ( empty($theme) )
|
||||
$fields['users_theme'] = NULL;
|
||||
else
|
||||
$fields['users_theme'] = $theme;
|
||||
|
||||
if (empty($page_limit) || !is_numeric($page_limit) || $page_limit < 10){
|
||||
$fields['users_page_limit'] = 25;
|
||||
}else{
|
||||
if($page_limit > 9999){
|
||||
$page_limit = 9999;
|
||||
}
|
||||
$fields['users_page_limit'] = $page_limit;
|
||||
}
|
||||
|
||||
if ( isset($_POST['new_password']) && !empty($_POST['new_password']) )
|
||||
$fields['users_passwd'] = md5($_POST['new_password']);
|
||||
|
||||
if ( !$db->editUser($fields,$user_id) )
|
||||
{
|
||||
print_failure(get_lang_f('failed_to_update_user_profile_error', $db->getError()));
|
||||
}
|
||||
else
|
||||
{
|
||||
print_success(get_lang_f('profile_of_user_modified_successfully',$login));
|
||||
$db->logger(get_lang_f('profile_of_user_modified_successfully',$login));
|
||||
}
|
||||
|
||||
global $view;
|
||||
if ( $isAdmin )
|
||||
{
|
||||
$view->refresh("?m=user_admin");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($_SESSION['REFER']))
|
||||
$view->refresh($_SESSION['REFER']);
|
||||
else
|
||||
$view->refresh("?m=user_admin&p=edit_user&user_id=".$_SESSION['user_id']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$ft = new FormTable();
|
||||
$ft->start_form('?m=user_admin&p=edit_user');
|
||||
$ft->add_field_hidden('user_id',$user_id);
|
||||
$ft->start_table();
|
||||
|
||||
$login_option = ( !$isAdmin ) ? 'readonly="readonly"' : "";
|
||||
$ft->add_field('string','login',$userInfo['users_login'],64,$login_option);
|
||||
|
||||
if ( $my_user_id === $user_id )
|
||||
{
|
||||
$ft->add_field('password','current_password','', 64);
|
||||
}
|
||||
|
||||
$ft->add_field('password','new_password','', 64);
|
||||
$ft->add_field('password','retype_new_password','', 64);
|
||||
$locale_files = makefilelist("lang/", ".|..|.svn", true, "folders");
|
||||
array_push($locale_files,"-");
|
||||
sort($locale_files);
|
||||
$ft->add_custom_field('language',
|
||||
create_drop_box_from_array($locale_files,"newlang",@$userInfo['users_lang']));
|
||||
|
||||
require_once('modules/settings/functions.php');
|
||||
$theme = "";
|
||||
$add_empty = FALSE;
|
||||
if ( isset($userInfo['users_theme']) )
|
||||
{
|
||||
$theme = $userInfo['users_theme'];
|
||||
$add_empty = TRUE;
|
||||
}
|
||||
|
||||
$ft->add_custom_field('theme', get_theme_html_str($theme, $add_empty));
|
||||
$ft->add_field('string','page_limit',$userInfo['users_page_limit'], 64);
|
||||
$ft->add_field('string','first_name',$userInfo['users_fname'], 64);
|
||||
$ft->add_field('string','last_name',$userInfo['users_lname'], 64);
|
||||
$ft->add_field('string','phone_number',$userInfo['users_phone'], 64);
|
||||
|
||||
$email_option = ( !$isAdmin and isset( $settings['editable_email'] ) and $settings['editable_email'] == "0" ) ? 'readonly="readonly"' : "";
|
||||
$ft->add_field('string','email_address',$userInfo['users_email'],64,$email_option);
|
||||
|
||||
$ft->add_field('string','city',$userInfo['users_city'], 64);
|
||||
$ft->add_field('string','province',$userInfo['users_province'], 64);
|
||||
$ft->add_field('string','country',$userInfo['users_country'], 64);
|
||||
$ft->add_field('string','api_token',$db->getApiToken($userInfo['user_id']), 64, "readonly");
|
||||
|
||||
// Receives email notifications (for admins only --- really)
|
||||
if ( $isAdmin ) {
|
||||
$ft->add_field('on_off','user_receives_emails',$userInfo['user_receives_emails']);
|
||||
}
|
||||
|
||||
if ( $isAdmin && $userInfo['users_role'] != "subuser" ) {
|
||||
$ft->add_custom_field('user_role',
|
||||
create_drop_box_from_array(array('user', 'admin','banned'),"newrole", $userInfo['users_role']));
|
||||
$ft->add_field('text','comment',$userInfo['users_comment'], 48);
|
||||
?>
|
||||
<tr>
|
||||
<td align='right'><?php print_lang('expires'); ?>:</td>
|
||||
<?php
|
||||
$timediff = $userInfo["user_expires"];
|
||||
//echo "Timediff is $timediff<br>";
|
||||
if(read_expire($timediff) !== 'X')
|
||||
{
|
||||
$exday = date("j", $timediff);
|
||||
$exyear = date("Y", $timediff);
|
||||
$exmonth = date("m", $timediff);
|
||||
$exhour = date("H", $timediff);
|
||||
$exmin = date("i", $timediff);
|
||||
}
|
||||
else
|
||||
{
|
||||
$exday = "X";
|
||||
$exyear = "X";
|
||||
$exmonth = "X";
|
||||
$exhour = "X";
|
||||
$exmin = "X";
|
||||
}
|
||||
|
||||
$minutes = range(0,59);
|
||||
$pad_length = 2;
|
||||
|
||||
foreach ($minutes as &$minute)
|
||||
{
|
||||
$minute = str_pad($minute, $pad_length, "0", STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$months = array('X' => 'X', '1' => 'Jan', '2' => 'Feb', '3' => 'Mar', '4' => 'Apr', '5' => 'May', '6' => 'Jun', '7' => 'July',
|
||||
'8' => 'Aug', '9' => 'Sep', '10' => 'Oct', '11' => 'Nov', '12' => 'Dec');
|
||||
|
||||
#The ugliness below is to populate the expiration fields with what is in the db
|
||||
#Looks bad, but it works well
|
||||
echo "<td align='left'>";
|
||||
$x_array = array('X');
|
||||
echo create_drop_box_from_array(array_merge($x_array,range(1,31)),"days",$exday,true);
|
||||
echo create_drop_box_from_array($months,"month",$exmonth,false);
|
||||
echo create_drop_box_from_array(array_merge($x_array,range(date('Y')-1,date('Y')+10)),
|
||||
"years",$exyear,true);
|
||||
echo " - ";
|
||||
echo create_drop_box_from_array(array_merge($x_array,range(0,23)),"hours",$exhour,true);
|
||||
echo ":";
|
||||
echo create_drop_box_from_array(array_merge($x_array,$minutes),"minutes",$exmin,true);
|
||||
echo "<tr><td colspan='2' class='info'>".get_lang('expires_info')."</td></tr>";
|
||||
}
|
||||
|
||||
$ft->end_table();
|
||||
$ft->add_button("submit","edit_user",get_lang('save_profile'));
|
||||
$ft->end_form();
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
// Module general information
|
||||
$module_title = "User admin";
|
||||
$module_version = "1.0";
|
||||
$db_version = 0;
|
||||
$module_required = TRUE;
|
||||
$module_menus = array(
|
||||
array( 'subpage' => '', 'name'=>'User Admin', 'group'=>'admin' ),
|
||||
array( 'subpage' => 'show_groups', 'name'=>'Group Admin', 'group'=>'admin' )
|
||||
);
|
||||
|
||||
?>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<navigation>
|
||||
<page key="edit_user" file="edit_user.php" access="admin,user,subuser" />
|
||||
<page key="add" file="add_user.php" access="admin" />
|
||||
<page key="del" file="del_user.php" access="admin" />
|
||||
<page key="add_to_group" file="add_to_group.php" access="admin,user" />
|
||||
<page key="del_from_group" file="del_from_group.php" access="admin,user" />
|
||||
<page key="add_group" file="add_group.php" access="admin,user" />
|
||||
<page key="del_group" file="del_group.php" access="admin,user" />
|
||||
<page key="show_groups" file="show_groups.php" access="admin,user" />
|
||||
<page key="default" file="show_users.php" access="admin" />
|
||||
</navigation>
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module() {
|
||||
global $db, $loggedInUserInfo;
|
||||
|
||||
$page_user = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1;
|
||||
$limit_user = (isset($_GET['limit']) && (int)$_GET['limit'] > 0) ? (int)$_GET['limit'] : 10;
|
||||
$search_field = (isset($_GET['search']) && !empty($_GET['search'])) ? $_GET['search'] : false;
|
||||
|
||||
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
|
||||
$limit_user = $loggedInUserInfo["users_page_limit"];
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="center">
|
||||
<h2><?php print_lang('add_new_group'); ?></h2>
|
||||
<p><?php print_lang('info_group'); ?></p>
|
||||
<?php
|
||||
require_once('includes/form_table_class.php');
|
||||
$ft = new FormTable();
|
||||
$ft->start_form('?m=user_admin&p=add_group');
|
||||
$ft->start_table();
|
||||
$ft->add_field('string','group_name','');
|
||||
$ft->end_table();
|
||||
$ft->add_button('submit','add_group',get_lang('add_group'));
|
||||
$ft->end_form();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo '<h2>'.get_lang('available_groups').'</h2>';
|
||||
|
||||
echo '<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 50%; vertical-align: middle; text-align: right;">
|
||||
<form action="home.php" method="GET" style="float:right;">
|
||||
<input type ="hidden" name="m" value="user_admin" />
|
||||
<input type ="hidden" name="p" value="show_groups" />
|
||||
<input name="search" type="text" id="search" value="' . $search_field . '"/>
|
||||
<input type="submit" value="'.get_lang('search').'" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
if ($db->isAdmin($_SESSION['user_id']))
|
||||
$result = $db->getGroupList_limit($page_user,$limit_user,$search_field);
|
||||
else
|
||||
$result = $db->getUserGroupList_limit($_SESSION['user_id'],$page_user,$limit_user,$search_field);
|
||||
|
||||
if ( $result === FALSE )
|
||||
{
|
||||
echo "<p class='note'>".get_lang('no_groups_available')."</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
echo "<table class='center'><tr class='tr$i'><td>".
|
||||
get_lang('actions')."</td><td>".get_lang('group_name')."</td><td>".
|
||||
get_lang('users')."</td></tr>";
|
||||
|
||||
foreach ( $result as $row ) #loop through the groups
|
||||
{
|
||||
$i++;
|
||||
echo "<tr class='tr$i'><td><a href='?m=user_games&p=assign&group_id=".$row['group_id']."'>[".
|
||||
get_lang('assign_homes')."]</a><br />
|
||||
<a href='?m=user_admin&p=del_group&group_id=".
|
||||
$row['group_id']."'>[".get_lang('delete_group').']</a>';
|
||||
echo "</td><td>".$row['group_name']."</td>";
|
||||
|
||||
echo "<td class='left'>";
|
||||
|
||||
|
||||
$subusersEnabled = $db->isModuleInstalled("subusers");
|
||||
$subEnabled = false;
|
||||
if(!$subusersEnabled){
|
||||
$available_users = $db->getAvailableUsersForGroup($row['group_id']);
|
||||
}else{
|
||||
if(!$db->isAdmin($_SESSION['user_id'])){
|
||||
$available_users = $db->getAvailableSubUsersForGroup($row['group_id'], $_SESSION['user_id']);
|
||||
$subEnabled = true;
|
||||
}else{
|
||||
$available_users = $db->getAvailableUsersForGroup($row['group_id']);
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_array($available_users) )
|
||||
{
|
||||
if(count($available_users) > 0){
|
||||
echo "<form action=\"?m=user_admin&p=add_to_group\" method=\"post\">".
|
||||
get_lang('add_user_to_group').
|
||||
": <select name=\"user_to_add\">";
|
||||
foreach ($available_users as $user_row )
|
||||
{
|
||||
echo "<option value=\"$user_row[user_id]\">" . htmlentities($user_row[users_login]) . "</option>";
|
||||
}
|
||||
echo "</select>\n";
|
||||
echo "<input type='hidden' name='group_id' value='$row[group_id]' />";
|
||||
echo "<input type='submit' name='add_user_to_group' value='".get_lang('add_user')."' />";
|
||||
echo "</form>\n";
|
||||
}else{
|
||||
if($subEnabled){
|
||||
echo "<p>" .get_lang('no_subusers'). "</p>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($subEnabled){
|
||||
echo "<p>" .get_lang('no_subusers'). "</p>";
|
||||
}
|
||||
}
|
||||
|
||||
$group_users = $db->listUsersInGroup($row['group_id']);
|
||||
|
||||
if (is_array($group_users))
|
||||
{
|
||||
echo "<ul>";
|
||||
foreach ($group_users as $user_id)
|
||||
{
|
||||
$user_info = $db->getUserById($user_id['user_id']);
|
||||
echo "<li><a href='?m=user_admin&p=del_from_group&group_id=".
|
||||
$row['group_id']."&user_id=".$user_id['user_id']."'>[".get_lang('remove_from_group').
|
||||
"]</a> $user_info[users_login]</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
if ($db->isAdmin($_SESSION['user_id']))
|
||||
$count_groups = $db->get_group_count($search_field);
|
||||
else
|
||||
$count_groups = $db->getUserGroupList_count($_SESSION['user_id'],$search_field);
|
||||
|
||||
if(isset($_GET['search']) && !empty($_GET['search'])){
|
||||
$uri = '?m=user_admin&p=show_groups&search='.$_GET['search'].'&limit='.$limit_user.'&page=';
|
||||
}
|
||||
else{
|
||||
$uri = '?m=user_admin&p=show_groups&limit='.$limit_user.'&page=';
|
||||
}
|
||||
echo paginationPages($count_groups[0]['total'], $page_user, $limit_user, $uri, 3, 'userGroups');
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
<script type="text/javascript" src="js/modules/show_users.js"></script>
|
||||
<style type="text/css">
|
||||
tr.hide{
|
||||
display: none;
|
||||
}
|
||||
table.userListTable{
|
||||
border-collapse: collapse;
|
||||
border: 0px;
|
||||
}
|
||||
table.userListTable td{
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
tr.subusersShowHide{cursor: pointer;}
|
||||
|
||||
th.subuserColumn{
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
td.actions{
|
||||
cursor: default;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* OGP - Open Game Panel
|
||||
* Copyright (C) 2008 - 2018 The OGP Development Team
|
||||
*
|
||||
* http://www.opengamepanel.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
function exec_ogp_module() {
|
||||
global $db, $view, $loggedInUserInfo;
|
||||
|
||||
$page_user = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1;
|
||||
$limit_user = (isset($_GET['limit']) && (int)$_GET['limit'] > 0) ? (int)$_GET['limit'] : 10;
|
||||
$search_field = (isset($_GET['search']) && !empty($_GET['search'])) ? $_GET['search'] : false;
|
||||
|
||||
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
|
||||
$limit_user = $loggedInUserInfo["users_page_limit"];
|
||||
}
|
||||
|
||||
echo '<h2>'.get_lang('users')."</h2>";
|
||||
|
||||
$result = $db->getUserList_limit($page_user, $limit_user, $search_field);
|
||||
|
||||
if (empty($result) && $search_field !== false) {
|
||||
print_failure(get_lang_f('no_results_found', htmlentities($search_field)));
|
||||
|
||||
$view->refresh("?m=user_admin", 5);
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 50%; vertical-align: middle; text-align: left;">
|
||||
<p><a href="?m=user_admin&p=add">'.get_lang("add_new_user").'</a></p>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: middle; text-align: right;">
|
||||
<form action="home.php" method="GET" style="float:right;">
|
||||
<input type ="hidden" name="m" value="user_admin" />
|
||||
<input name="search" type="text" id="search" value="' . $search_field . '"/>
|
||||
<input type="submit" value="'.get_lang('search').'" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
echo '<table class="userListTable center" style="width: 100%;margin-top:50px;">';
|
||||
echo '<tr><th>'.get_lang('actions')."</th><th>".get_lang('username')."</th>";
|
||||
echo "<th>".get_lang('user_role')."</th>";
|
||||
echo "<th>".get_lang('email_address')."</th>";
|
||||
echo "<th>".get_lang('expires')."</th>";
|
||||
echo "<th class='subuserColumn'>".get_lang('subusers')."</th></tr>";
|
||||
|
||||
$i = 0;
|
||||
foreach ( $result as $row )
|
||||
{
|
||||
// Show user's parent
|
||||
$ownedBy = "";
|
||||
if(!is_null($row['users_parent'])){
|
||||
$ownedBy = $row['users_parent'];
|
||||
$parentInfo = $db->getUserById($ownedBy);
|
||||
if(is_array($parentInfo) && array_key_exists("user_expires", $parentInfo) && $parentInfo['user_expires'] != "X"){
|
||||
$row['user_expires'] = $parentInfo['user_expires'];
|
||||
}
|
||||
}
|
||||
|
||||
$user_expires = read_expire($row['user_expires']);
|
||||
print "<tr class='tr".($i++%2)." ";
|
||||
print $row['users_role'] . " ";
|
||||
if(!empty($ownedBy) && empty($search_field)){
|
||||
print "hide";
|
||||
}else{
|
||||
print "subusersShowHide";
|
||||
}
|
||||
print "' uid='" . $row['user_id'] . "'";
|
||||
if(!empty($ownedBy)){
|
||||
print "ownedby='" . $ownedBy . "'";
|
||||
}
|
||||
print ">";
|
||||
print "<td class='actions'><a href='?m=user_games&p=assign&user_id=$row[user_id]'>[".
|
||||
get_lang('assign_homes')."]</a><br />
|
||||
<a href='?m=user_admin&p=del&user_id=$row[user_id]'>[".get_lang('delete')."]</a><br />
|
||||
<a href='?m=user_admin&p=edit_user&user_id=$row[user_id]'>[".get_lang('edit_profile')."]</a></td>
|
||||
<td>".htmlentities($row['users_login'])."</td><td>".htmlentities($row['users_role'])."</td>
|
||||
<td>".htmlentities($row['users_email'])."</td>
|
||||
<td>$user_expires</td>";
|
||||
if(!empty($ownedBy)){
|
||||
print "<td></td>";
|
||||
}else{
|
||||
print "<td class='subUserShowHideTextTd expand' showtext='" . get_lang('show_subusers') . "' hidetext='" . get_lang('hide_subusers') . "'>" . get_lang('show_subusers') . " ↓</td>";
|
||||
}
|
||||
print "</tr>";
|
||||
}
|
||||
echo '</table><br>';
|
||||
|
||||
$count_users = $db->get_user_count($search_field);
|
||||
|
||||
if(isset($_GET['search']) && !empty($_GET['search'])){
|
||||
$uri = '?m=user_admin&search='.$_GET['search'].'&limit='.$limit_user.'&page=';
|
||||
}
|
||||
else{
|
||||
$uri = '?m=user_admin&limit='.$limit_user.'&page=';
|
||||
}
|
||||
echo paginationPages($count_users[0]['total'], $page_user, $limit_user, $uri, 3, 'userManager');
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue