-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Yasinsky
committed
Mar 5, 2013
1 parent
4f79aa4
commit 2ed13de
Showing
12 changed files
with
355 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 32 additions & 9 deletions
41
mail.oopzy.com/code/var/mail.oopzy.com/app/controllers/main/save_message.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
<?php | ||
/* | ||
* This returns a json array of boxes for given starting string | ||
*/ | ||
|
||
require_once APP_PATH. 'models/oopzy_model.php'; | ||
/*String*/ function _save_message() | ||
{ | ||
$ref = $_POST['ref']; | ||
$to = $_POST['to']; | ||
|
||
$tmp = explode(':',$ref); | ||
$tmp = explode('@',$tmp[0]); | ||
$box = $tmp[0]; | ||
|
||
$toemail = $_POST['to']; | ||
|
||
$redis = new Redis(); | ||
|
||
try{ | ||
|
||
$redis->connect($GLOBALS['REDISHOST'], $GLOBALS['REDISPORT']); | ||
//put request in a queue | ||
|
||
echo json_encode(array($ref,$to)); | ||
die; | ||
$oopzy = new Oopzy_model(); | ||
|
||
$message = ''; | ||
|
||
//see if link is established already and we can process | ||
if( !$oopzy->is_linked($box, $toemail) ) | ||
{ | ||
//send verification emai; | ||
$oopzy->verify_email($toemail, $box); | ||
|
||
$message = utils::get_message('MSG_SAVE_MESSAGE_VERIFY'); | ||
} | ||
|
||
$oopzy->do_remail_queue($ref, $box, $toemail); | ||
|
||
//set autoremail | ||
//if box quality is low not much we can do box_quality($box) | ||
//also here where we can set $key request | ||
|
||
} | ||
catch(Exception $e) | ||
{ | ||
echo json_encode(array('error' => $e->getMessage())); | ||
die; | ||
$message = $e->getMessage(); | ||
} | ||
|
||
utils::error_echo_die($message); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
mail.oopzy.com/code/var/mail.oopzy.com/app/controllers/main/verify_token.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
require_once APP_PATH. 'models/oopzy_model.php'; | ||
/* | ||
* This returns a json array of boxes for given starting string | ||
*/ | ||
/*void*/ function _verify_token($obj='') | ||
{ | ||
|
||
if(isset($_POST['obj'])) | ||
{ | ||
$obj = urldecode($_POST['obj']); | ||
} | ||
else | ||
{ | ||
$obj = urldecode($obj); | ||
} | ||
|
||
$verify = new Oopzy_model(); | ||
|
||
if(!$verify->verify_token($obj)) | ||
{ | ||
utils::error_echo_die($verify->get_error()); | ||
} | ||
|
||
//TODO , Token redirect | ||
|
||
utils::error_echo_die(""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.