3 class NP_MailaddressLogin extends NucleusPlugin
7 return 'Login by Mailaddress';
17 return 'http://www.souhoudou.jp/';
25 function getDescription()
27 return 'Login to NucleusCMS via mailaddress';
30 function supportsFeature($what)
33 case 'SqlTablePrefix':
40 function getEventList()
49 function event_CustomLogin($data)
55 ' . sql_table('member') . '
57 memail = "' . sql_real_escape_string($data['login']) . '" and
58 mpassword = "' . md5($data['password']) . '"';
59 if ($mname = quickQuery($query)) {
60 $data['login'] = $mname;
62 $data['allowlocal'] = 1;
66 function event_PostRegister($data)
68 $member = $data['member'];
69 $mailAddr = $member->getEmail();
70 if (empty($mailAddr)) {
73 $userMail = quickQuery('
77 ' . sql_table('member') . '
79 memail = "' . sql_real_escape_string($mailAddr) . '"'
83 $adm->deleteOneMember($member->getID());
88 function event_ValidateForm($data)
91 $accountCreate = ($data['type'] == 'membermail' && $data['error'] === 1);
92 if (!$CONF['AllowMemberCreate'] || !$accountCreate) {
95 $mailAddr = postVar('email');
96 if (empty($mailAddr)) {
97 $data['error'] = 'Mail address is empty';
100 $userMail = quickQuery('
104 ' . sql_table('member') .
107 memail = "' . sql_real_escape_string($mailAddr) . '"'
110 $data['error'] = 'Mail address is avaiable';