public function GetSRegDataForRequest(User $user) { require_once 'Auth/OpenID/SReg.php'; // Other common SReg fields we could fill are: // dob, country, language, timezone. $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest($this->request); return Auth_OpenID_SRegResponse::extractResponse($sreg_request, array('fullname' => $user->fullName(), 'nickname' => $user->displayName(), 'email' => $user->bestEmail(), 'gender' => $user->isFemale() ? 'F' : 'M')); }
public function ApplayToUser($user_id) { global $bd_users; if (!$this->Exist()) { return false; } $work_user = new User($user_id, $bd_users['id']); if (!$work_user->id()) { return false; } $female = $work_user->isFemale(); if ($this->isFemaleSkin() and !$female or !$this->isFemaleSkin() and $female) { return false; } if (!$work_user->getPermission('sp_change') or $work_user->getPermission('max_ratio') < $this->ratio) { return false; } $work_user->deleteSkin(); $work_user->deleteBuffer(); $user_skin_way = $work_user->getSkinFName(); if (copy($this->base_dir . $this->fname, $user_skin_way)) { chmod($user_skin_way, 0777); } else { return false; } if (!strcmp($work_user->defaultSkinMD5(), md5_file($work_user->getSkinFName()))) { $work_user->defaultSkinTrigger(true); } else { $work_user->defaultSkinTrigger(false); } BD("UPDATE `{$this->db}` SET `downloads` = downloads + 1 WHERE `id`='" . $this->id . "'"); return true; }
$do = $default_do; } $html = ''; $info = ''; $server_info = ''; $user_id = Filter::input('user_id', 'post', 'int', true); $ban_user = false; if ($user_id === false) { $user_id = Filter::input('user_id', 'get', 'int', true); } if ($user_id) { $ban_user = new User($user_id); } if ($ban_user and $ban_user->id()) { $user_name = $ban_user->name(); $user_gen = $ban_user->isFemale(); $user_mail = $ban_user->email(); $user_ip = $ban_user->ip(); $user_lvl = $ban_user->lvl(); } else { $ban_user = false; } if ($do == 'gettheme') { $id = Filter::input('sid', 'get', 'string', true); } else { $id = Filter::input('sid', 'get', 'int', true); } function RatioList($selectid = 1) { $html_ratio = '<option value="1" ' . (1 == $selectid ? 'selected' : '') . '>64x32 | 22x17</option>'; for ($i = 2; $i <= 32; $i = $i + 2) {
public function Show($for_user = false) { if (!$this->Exist()) { return 'Error : comment'; } $line = getDB()->fetchRow("SELECT DATE_FORMAT(time, '%d.%m.%Y | %H:%i:%S') AS time, message, item_id FROM `{$this->db}` WHERE `id`='" . $this->id . "'"); if (!$line) { return ''; } $admin_buttons = ''; $female_mark = ''; $text = Message::BBDecode($line['message']); $date = $line['time']; $id = $this->id; $item_id = $line['item_id']; $this_user = new User($this->user_id); $user_id = $this->user_id; $user_name = $this_user->id() ? $this_user->name() : 'Banned'; $user_female = $this_user->id() ? $this_user->isFemale() : false; $user_img_get = $this_user->getSkinLink(true); if ($for_user and ($for_user->getPermission('adm_comm') or $for_user->id() == $this->user_id)) { ob_start(); include $this->GetView('comments_admin.html'); $admin_buttons = ob_get_clean(); } if ($user_female) { $female_mark = $this->ShowPage('comments_girl.html'); } ob_start(); if ($for_user) { include $this->GetView('comments.html'); } else { include $this->GetView('comments_unauth.html'); } return ob_get_clean(); }
private function validSubscription(User $user) { global $globals; $this->removeSubscriptionRequest($user->id()); Group::subscribe($globals->asso('id'), $user->id()); if (XDB::affectedRows() == 1 && $user->forlifeEmail()) { $mailer = new PlMailer(); $mailer->addTo($user->forlifeEmail()); $mailer->setFrom('"' . S::user()->fullName() . '" <' . S::user()->forlifeEmail() . '>'); $mailer->setSubject('[' . $globals->asso('nom') . '] Demande d\'inscription'); $message = ($user->isFemale() ? 'Chère' : 'Cher') . " Camarade,\n" . "\n" . " Suite à ta demande d'adhésion à " . $globals->asso('nom') . ", j'ai le plaisir de t'annoncer que ton inscription a été validée !\n" . (is_null($globals->asso('welcome_msg')) ? '' : "\n" . $globals->asso('welcome_msg') . "\n") . "\n" . "Bien cordialement,\n" . "-- \n" . S::user()->fullName() . '.'; $mailer->setTxtBody(wordwrap($message, 72)); $mailer->send(); } }