Permalink
Browse files

Add authentication to the email API #665

* Also fixes undefined variable $ret_value error
  • Loading branch information...
rjmackay committed Jul 4, 2012
1 parent fcdad03 commit 4c24325f5f1ec90c56e09c7437ae72b952a27b4f
Showing with 16 additions and 2 deletions.
  1. +16 −2 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
*
@@ -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();
}
@@ -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(
@@ -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;
}
}

0 comments on commit 4c24325

Please sign in to comment.