Ejemplo n.º 1
0
 public function onRemFromGroup($uid)
 {
     $uid = (int) $uid;
     $gid = $this->group->getID();
     if (false === GDO::table('GWF_UserGroup')->deleteWhere("ug_userid={$uid} AND ug_groupid={$gid}")) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === GWF_UserGroup::fixGroupMC()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_removed_from_grp', array(GWF_User::getByID($uid)->displayUsername(), $this->group->display('group_name')));
 }
Ejemplo n.º 2
0
 private function onRequestMail(GWF_Group $group, GWF_User $user, GWF_UsergroupsInvite $request)
 {
     if (false === ($leader = $group->getFounder())) {
         return false;
     }
     if ('' === ($email = $leader->getValidMail())) {
         return false;
     }
     $userid = $user->getID();
     $groupid = $group->getID();
     $token = $request->getHashcode();
     $link = Common::getAbsoluteURL('index.php?mo=Usergroups&me=Accept&uid=' . $userid . '&gid=' . $groupid . '&token=' . $token);
     $link = GWF_HTML::anchor($link, $link);
     $mail = new GWF_Mail();
     $mail->setSender(GWF_BOT_EMAIL);
     $mail->setReceiver($email);
     $mail->setSubject($this->module->lang('mail_subj_req', array($user->displayUsername(), $group->display('group_name'))));
     $mail->setBody($this->module->lang('mail_body_req', array($leader->displayUsername(), $user->displayUsername(), $group->display('group_name'), $link)));
     return $mail->sendToUser($leader);
 }
Ejemplo n.º 3
0
 private function formDelete(GWF_Group $group)
 {
     $data = array('del_groupname' => array(GWF_Form::STRING, '', $this->module->lang('th_del_groupname'), $this->module->lang('tt_del_groupname')), 'del_confirm' => array(GWF_Form::SUBMIT, $this->module->lang('btn_del_group', array($group->display('group_name')))));
     return new GWF_Form($this, $data);
 }