mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
r291
git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@291 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
6a33fcba58
commit
4553d083d7
3 changed files with 60 additions and 47 deletions
|
@ -42,6 +42,10 @@ switch ($ajax->action)
|
|||
case 'user_register':
|
||||
require(INC_DIR .'functions_validate.php');
|
||||
break;
|
||||
|
||||
case 'manage_user':
|
||||
require(INC_DIR .'functions_admin.php');
|
||||
break;
|
||||
}
|
||||
|
||||
// position in $ajax->valid_actions['xxx']
|
||||
|
@ -63,13 +67,13 @@ class ajax_common
|
|||
'edit_user_profile' => array('admin'),
|
||||
'change_user_rank' => array('admin'),
|
||||
'change_user_opt' => array('admin'),
|
||||
'delete_userdata' => array('admin'),
|
||||
|
||||
'change_tor_status' => array('mod'),
|
||||
'mod_action' => array('mod'),
|
||||
|
||||
'gen_passkey' => array('user'),
|
||||
'change_torrent' => array('user'),
|
||||
'manage_user' => array('user'),
|
||||
|
||||
'view_post' => array('guest'),
|
||||
'view_torrent' => array('guest'),
|
||||
|
@ -485,9 +489,9 @@ class ajax_common
|
|||
require(AJAX_DIR .'posts.php');
|
||||
}
|
||||
|
||||
function delete_userdata()
|
||||
function manage_user()
|
||||
{
|
||||
require(AJAX_DIR .'delete_userdata.php');
|
||||
require(AJAX_DIR .'manage_user.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,8 @@ switch($mode)
|
|||
if ($userdata['user_id'] == $user_id) $this->ajax_die($lang['USER_DELETE_ME']);
|
||||
if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['USER_DELETE_CONFIRM']);
|
||||
|
||||
if ($user_id != 2 && $user_id != BOT_UID)
|
||||
if ($user_id != BOT_UID)
|
||||
{
|
||||
require(INC_DIR .'functions_admin.php');
|
||||
|
||||
user_delete($user_id);
|
||||
delete_user_sessions($user_id);
|
||||
|
||||
|
@ -25,14 +23,27 @@ switch($mode)
|
|||
else $this->ajax_die($lang['USER_DELETE_CSV']);
|
||||
break;
|
||||
|
||||
case 'delete_message':
|
||||
case 'delete_topics':
|
||||
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']);
|
||||
if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_CONFIRM']);
|
||||
if (empty($this->request['confirmed'])) $this->prompt_for_confirm('Óäàëèòü âñå ñîîáùåíèÿ è âñå íà÷àòûå þçåðîì òîïèêè öåëèêîì?');
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
require(INC_DIR .'functions_admin.php');
|
||||
$user_topics = DB()->fetch_rowset("SELECT topic_id FROM ". BB_TOPICS ." WHERE topic_poster = $user_id", 'topic_id');
|
||||
$deleted_topics = topic_delete($user_topics);
|
||||
$deleted_posts = post_delete('user', $user_id);
|
||||
|
||||
$this->response['info'] = $lang['USER_DELETED_POSTS'];
|
||||
}
|
||||
else $this->ajax_die($lang['NOT_ADMIN']);
|
||||
break;
|
||||
|
||||
case 'delete_message':
|
||||
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']);
|
||||
if (empty($this->request['confirmed'])) $this->prompt_for_confirm('Óäàëèòü âñå ñîîáùåíèÿ, êðîìå çàãëàâíûõ?');
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
post_delete('user', $user_id);
|
||||
|
||||
$this->response['info'] = $lang['USER_DELETED_POSTS'];
|
|
@ -92,9 +92,13 @@ $(document).ready(function(){
|
|||
<var class="ajax-params">{action: "edit_user_profile", id: "u_up_release"}</var>
|
||||
<var class="ajax-params">{action: "edit_user_profile", id: "u_up_bonus"}</var>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- ENDIF / SHOW_ADMIN_OPTIONS -->
|
||||
|
||||
<script type="text/javascript">
|
||||
ajax.callback.manage_user = function(data) {
|
||||
if(data.info) alert(data.info);
|
||||
if(data.url) document.location.href = data.url;
|
||||
};
|
||||
</script>
|
||||
<a name="editprofile"></a>
|
||||
|
||||
<h1 class="pagetitle">{L_VIEWING_PROFILE}</h1>
|
||||
|
@ -211,7 +215,8 @@ $(document).ready(function(){
|
|||
<td id="user_regdate">
|
||||
<span class="editable bold">{USER_REGDATE}</span>
|
||||
<!-- IF IS_ADMIN -->
|
||||
[ <a href="#" onclick="ajax.exec({action : 'delete_userdata', mode: '<!-- IF USER_ACTIVE -->user_deactivate<!-- ELSE -->user_activate<!-- ENDIF -->', user_id : {PROFILE_USER_ID}}); return false;" class="<!-- IF USER_ACTIVE -->adm<!-- ELSE -->seed bold<!-- ENDIF -->"><!-- IF USER_ACTIVE -->{L_USER_DEACTIVATE}<!-- ELSE -->{L_USER_ACTIVATE}<!-- ENDIF --></a> ]
|
||||
[ <a href="#" onclick="ajax.exec({action : 'manage_user', mode: '<!-- IF USER_ACTIVE -->user_deactivate<!-- ELSE -->user_activate<!-- ENDIF -->', user_id : {PROFILE_USER_ID}}); return false;" class="<!-- IF USER_ACTIVE -->adm<!-- ELSE -->seed bold<!-- ENDIF -->"><!-- IF USER_ACTIVE -->{L_USER_DEACTIVATE}<!-- ELSE -->{L_USER_ACTIVATE}<!-- ENDIF --></a> ]
|
||||
[ <a href="#" onclick="ajax.exec({action : 'manage_user', mode: 'delete_profile', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">{L_USER_DELETE_EXPLAIN}</a> ]
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -241,15 +246,8 @@ $(document).ready(function(){
|
|||
<!-- IF IS_ADMIN -->
|
||||
<tr id="delete" style="display: none;">
|
||||
<td colspan="2" class="med tCenter">
|
||||
[ <a href="#" onclick="ajax.exec({action : 'delete_userdata', mode: 'delete_profile', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">{L_USER_DELETE_EXPLAIN}</a> ]
|
||||
[ <a href="#" onclick="ajax.exec({action : 'delete_userdata', mode: 'delete_message', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">{L_DELETE_USER_POSTS}</a> ]
|
||||
|
||||
<script type="text/javascript">
|
||||
ajax.callback.delete_userdata = function(data) {
|
||||
if(data.info) alert(data.info);
|
||||
if(data.url) document.location.href = data.url;
|
||||
};
|
||||
</script>
|
||||
[ <a href="#" onclick="ajax.exec({action : 'manage_user', mode: 'delete_topics', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">топики целиком</a> ]
|
||||
[ <a href="#" onclick="ajax.exec({action : 'manage_user', mode: 'delete_message', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">все, кроме заглавных</a> ]
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue