mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Перенос файлов движка в корень
This commit is contained in:
parent
584f692288
commit
f94c0dd2ee
585 changed files with 14 additions and 14 deletions
33
library/ajax/change_user_opt.php
Normal file
33
library/ajax/change_user_opt.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
if (!defined('IN_AJAX')) die(basename(__FILE__));
|
||||
|
||||
global $bf, $lang;
|
||||
|
||||
$user_id = (int) $this->request['user_id'];
|
||||
$new_opt = bb_json_decode($this->request['user_opt']);
|
||||
|
||||
if (!$user_id OR !$u_data = get_userdata($user_id))
|
||||
{
|
||||
$this->ajax_die('invalid user_id');
|
||||
}
|
||||
|
||||
if (!is_array($new_opt))
|
||||
{
|
||||
$this->ajax_die('invalid new_opt');
|
||||
}
|
||||
|
||||
foreach ($bf['user_opt'] as $opt_name => $opt_bit)
|
||||
{
|
||||
if (isset($new_opt[$opt_name]))
|
||||
{
|
||||
setbit($u_data['user_opt'], $opt_bit, !empty($new_opt[$opt_name]));
|
||||
}
|
||||
}
|
||||
|
||||
DB()->query("UPDATE ". BB_USERS ." SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1");
|
||||
|
||||
// Удаляем данные из кеша
|
||||
cache_rm_user_sessions ($user_id);
|
||||
|
||||
$this->response['resp_html'] = $lang['SAVED'];
|
Loading…
Add table
Add a link
Reference in a new issue