Skip to content

Commit

Permalink
Add authentication to the email API #665
Browse files Browse the repository at this point in the history
* Also fixes undefined variable $ret_value error
  • Loading branch information
rjmackay committed Jul 4, 2012
1 parent fcdad03 commit 4c24325
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions application/libraries/api/MY_Email_Api_Object.php
@@ -1,6 +1,6 @@
<?php defined('SYSPATH') or die('No direct script access.');
/**
* This class handles GET request for KML via the API.
* This class handles GET request for Email via the API.
*
* @version 25 - Emmanuel Kala 2010-10-27
*
Expand All @@ -26,6 +26,13 @@ public function __construct($api_service)
*/
public function perform_task()
{
// Authenticate the user
if ( ! $this->api_service->_login(TRUE))
{
$this->set_error_message($this->response(2));
return;
}

$this->_list_all_email_msgs();
}

Expand All @@ -34,6 +41,13 @@ public function perform_task()
*/
public function email_action()
{
// Authenticate the user
if ( ! $this->api_service->_login(TRUE))
{
$this->set_error_message($this->response(2));
return;
}

if ( ! $this->api_service->verify_array_index($this->request, 'action'))
{
$this->set_error_message(array(
Expand Down Expand Up @@ -159,7 +173,7 @@ public function _delete_email_msg()
//email id doesn't exist in DB
//TODO i18nize the string
$this->error_messages .= "Email ID does not exist.";
$this->ret_value = 1;
$ret_value = 1;

}
}
Expand Down

0 comments on commit 4c24325

Please sign in to comment.