function mo_del_user($uid) { global $db; $sql = 'DELETE FROM `mo_user` WHERE `id` = ?'; $db->prepare($sql); $db->bind('i', $uid); $db->execute(); $sql = 'DELETE FROM `mo_user_info` WHERE `uid` = ?'; $db->prepare($sql); $db->bind('i', $uid); $db->execute(); $sql = 'DELETE FROM `mo_user_record` WHERE `uid` = ?'; $db->prepare($sql); $db->bind('i', $uid); $db->execute(); mo_write_note("The user (ID = {$uid}) has been deleted."); mo_log_user("The user (ID = {$uid}) has been deleted."); return True; }
function mo_add_new_discussion($category, $title, $content, $parent = 0, $uid = 0, $extra = array()) { global $user; if (!$uid) { $uid = $user->getUID(); } if (!($uid && ($parent || $title) && $content)) { return False; } global $db; $sql = 'INSERT INTO `mo_discussion` (`uid`, `parent`, `title`, `category`, `content`, `post_time`, `extra`, `ip`) VALUES (?, ?, ?, ?, ?, CURRENT_TIMESTAMP, ?, ?)'; $db->prepare($sql); $db->bind('iisissi', $uid, $parent, $title, $category, $content, serialize($extra), mo_get_user_ip()); $db->execute(); $did = $db->getInsID(); mo_write_note('A new discussion has been added.'); mo_log_user("User added a new discussion (DID = {$did})."); return $did; }
function socket_push($data) { if (!mo_com_socket($data)) { mo_log_user('Solution Failed Pushing (SID = ' . $data['sid'] . ').'); return False; } else { return True; } }
public function refresh_login() { global $db; $this->status['mask'] = (int) $this->status['mask'] + 1; $this->status['mask'] = (string) $this->status['mask']; $sql = 'UPDATE `mo_user` SET `mask` = ? WHERE `mo_user`.`id` = ?'; $db->prepare($sql); $db->bind('ii', $this->status['mask'], $this->uid); $db->execute(); $_SESSION['mask'] = $this->status['mask']; mo_log_user('The user (ID = ' . $_SESSION['uid'] . ') has refreshed the saved password.'); }