Fix auto-login (avoid multiple confirmation emails)
This commit is contained in:
17
inc/spot.php
17
inc/spot.php
@@ -48,7 +48,8 @@ class Spot extends Main
|
|||||||
array('name'=>'project', 'project'=>true),
|
array('name'=>'project', 'project'=>true),
|
||||||
array('name'=>'media', 'project'=>true),
|
array('name'=>'media', 'project'=>true),
|
||||||
array('name'=>'converter', 'project'=>true),
|
array('name'=>'converter', 'project'=>true),
|
||||||
array('name'=>'user', 'project'=>true)
|
array('name'=>'user', 'project'=>true),
|
||||||
|
array('name'=>'email', 'project'=>true)
|
||||||
);
|
);
|
||||||
parent::__construct($oClassManagement, $sProcessPage, $asClasses, true, __FILE__, $sTimezone);
|
parent::__construct($oClassManagement, $sProcessPage, $asClasses, true, __FILE__, $sTimezone);
|
||||||
|
|
||||||
@@ -172,7 +173,7 @@ class Spot extends Main
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function genCronFile() {
|
public function genCronFile() {
|
||||||
//$bResult = (file_put_contents('spot_cron.sh', '#!/bin/bash'."\n".'cd '.dirname($_SERVER['SCRIPT_FILENAME'])."\n".'php -f index.php a=update_feed')!==false);
|
//$bSuccess = (file_put_contents('spot_cron.sh', '#!/bin/bash'."\n".'cd '.dirname($_SERVER['SCRIPT_FILENAME'])."\n".'php -f index.php a=update_feed')!==false);
|
||||||
$sFileName = 'spot_cron.sh';
|
$sFileName = 'spot_cron.sh';
|
||||||
$sContent =
|
$sContent =
|
||||||
'#!/bin/bash'."\n".
|
'#!/bin/bash'."\n".
|
||||||
@@ -215,16 +216,16 @@ class Spot extends Main
|
|||||||
|
|
||||||
public function subscribe($sEmail) {
|
public function subscribe($sEmail) {
|
||||||
$asResult = $this->oUser->addUser($sEmail, $this->oLang->getLanguage());
|
$asResult = $this->oUser->addUser($sEmail, $this->oLang->getLanguage());
|
||||||
|
$asUserInfo = $this->oUser->getUserInfo();
|
||||||
|
|
||||||
//Send Confirmation Email
|
//Send Confirmation Email
|
||||||
if($asResult['result']) {
|
if($asResult['result'] && $asResult['desc']=='lang:nl_subscribed') {
|
||||||
$this->oClassManagement->incClass('email', true);
|
$oConfEmail = new Email($this->asContext['serv_name'], 'email_confirmation');
|
||||||
$oConfEmail = new Email($this->asContext['serv_name'],'email_confirmation');
|
$oConfEmail->setDestInfo($asUserInfo);
|
||||||
$oConfEmail->setDestInfo($this->oUser->getUserInfo());
|
|
||||||
$oConfEmail->send();
|
$oConfEmail->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::getJsonResult($asResult['result'], $asResult['desc'], $asResult['data']);
|
return self::getJsonResult($asResult['result'], $asResult['desc'], $asUserInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unsubscribe() {
|
public function unsubscribe() {
|
||||||
@@ -237,7 +238,7 @@ class Spot extends Main
|
|||||||
$this->oLang->setLanguage($this->oUser->getLang(), self::DEFAULT_LANG);
|
$this->oLang->setLanguage($this->oUser->getLang(), self::DEFAULT_LANG);
|
||||||
$asResult = $this->oUser->removeUser();
|
$asResult = $this->oUser->removeUser();
|
||||||
|
|
||||||
$sDesc = $asResult['desc'];
|
$sDesc = $asResult['desc'];
|
||||||
if($sDesc=='') $sDesc = $this->oLang->getTranslation('nl_unsubscribed');
|
if($sDesc=='') $sDesc = $this->oLang->getTranslation('nl_unsubscribed');
|
||||||
return $sDesc;
|
return $sDesc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class User extends PhpObject {
|
|||||||
$this->updateCookie();
|
$this->updateCookie();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Spot::getResult($bSuccess, $sDesc, $this->getUserInfo());
|
return Spot::getResult($bSuccess, $sDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeUser() {
|
public function removeUser() {
|
||||||
|
|||||||
Reference in New Issue
Block a user