Index: sandbox/2.4.3-expresso-rest/prototype/rest/mail/MailLastResource.php
===================================================================
--- sandbox/2.4.3-expresso-rest/prototype/rest/mail/MailLastResource.php	(revision 6528)
+++ 	(revision )
@@ -1,99 +1,0 @@
-<?php
- 
-use prototype\api\Config as Config;
-
-class MailLastResource extends Resource {
- 
-    /**
-    * Busca as Ãºltimas 20 menssagens nÃ£o lidas do usuÃ¡rio
-    *
-    * @license    http://www.gnu.org/copyleft/gpl.html GPL
-    * @author     ConsÃ³rcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-    * @sponsor    Caixa EconÃŽmica Federal
-    * @author     Cristiano CorrÃªa Schmidt
-    * @return     Lista das ultimas 10 menssagens do usuÃ¡rio nÃ£o lidas
-    * @access     public
-    **/
-    function get($request) 
-    {
-	$this->secured();
-	
-        $response = new Response($request);
-        $response->code = Response::OK;
-        $response->addHeader('Content-type', 'aplication/json');
-		
-	$cyrus = Config::service('Cyrus', 'config');
-	$options = ($cyrus['tlsEncryption']) ? '/tls/novalidate-cert' : '/notls/novalidate-cert'; 
-	$mbox = imap_open( '{'.$cyrus['host'].":".$cyrus['port'].$options.'}INBOX' , Config::me('uid') , Config::me('password') );
-	
-	$msgIds = imap_sort( $mbox , SORTDATE , 1 , null , "UNSEEN" , 'UTF-8');
-	$msgIds = array_splice($msgIds , 0 , 20);
-	
-	$return = array();
-	
-	foreach ($msgIds as $key => &$value) 
-	{    
-	      $header = imap_headerinfo( $mbox, $value );
-	      $return[$key]['subject'] = ( isset($header->subject) && trim($header->subject) !== '' ) ?  self::decodeMimeString($header->subject) : 'No Subject';
-	      $return[$key]['date'] =  $header->udate;
-	      $return[$key]['from'] =  (isset( $header->from[0] )) ? self::formatMailObject( $header->from[0] ) : array( 'name' => '' , 'mail' => '');
-	}
-
-	$response->body = json_encode($return);
-	
-	imap_close($mbox);
-	return $response;
-    }
-
-    
-    
-    /**
-    *  Decodifica os tokens encontrados na funÃ§Ã£o decodeMimeString
-    * 
-    * @license    http://www.gnu.org/copyleft/gpl.html GPL
-    * @author     ConsÃ³rcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-    * @sponsor    Caixa EconÃ³mica Federal
-    * @author     Cristiano CorrÃªa Schmidt
-    * @return     bool
-    * @access     public
-    */
-    static private function decodeMimeStringCallback( $mathes )
-    {
-       $str = (strtolower($mathes[2]) == 'q') ?  quoted_printable_decode(str_replace('_','=20',$mathes[3])) : base64_decode( $mathes[3]) ;
-       return ( strtoupper($mathes[1]) == 'ISO-8859-1' ) ? mb_convert_encoding(  $str , 'UTF-8' , 'ISO-8859-1') : $str;
-    }
-
-    /**
-    *  Decodifica uma string no formato mime RFC2047
-    *
-    * @license    http://www.gnu.org/copyleft/gpl.html GPL
-    * @author     ConsÃ³rcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-    * @sponsor    Caixa EconÃ³mica Federal
-    * @author     Cristiano CorrÃªa Schmidt
-    * @return     bool
-    * @access     public
-    */
-    static private function decodeMimeString( $string )
-    {
-      $string =  preg_replace('/\?\=(\s)*\=\?/', '?==?', $string);
-      return preg_replace_callback( '/\=\?([^\?]*)\?([qb])\?([^\?]*)\?=/i' ,array( 'self' , 'decodeMimeStringCallback'), $string);
-    }
-    
-     /**
-    *  Formata um mailObject para um array com name e email
-    *
-    * @license    http://www.gnu.org/copyleft/gpl.html GPL
-    * @author     ConsÃ³rcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-    * @sponsor    Caixa EconÃ³mica Federal
-    * @author     Cristiano CorrÃªa Schmidt
-    * @return     bool
-    * @access     public
-    */
-    static private function formatMailObject( $obj )
-    {
-	$return = array();
-	$return['mail'] = self::decodeMimeString($obj->mailbox) . (( isset( $obj->host) && $obj->host != ('unspecified-domain') &&  $obj->host !=  '.SYNTAX-ERROR.')? '@'. $obj->host : '');
-	$return['name'] = ( isset( $obj->personal ) && trim($obj->personal) !== '' ) ? self::decodeMimeString($obj->personal) :  $return['mail'];
-	return $return;
-    }
-}
Index: sandbox/2.4.3-expresso-rest/prototype/rest/calendar/CalendarLastResource.php
===================================================================
--- sandbox/2.4.3-expresso-rest/prototype/rest/calendar/CalendarLastResource.php	(revision 6528)
+++ 	(revision )
@@ -1,53 +1,0 @@
-<?php
-
-use prototype\api\Config as Config;
-
-class CalendarLastResource extends Resource{
-
-    
-    /**
-    * Busca os eventos contidos nas agendas assinas do usuÃ¡rio
-    *
-    * @license    http://www.gnu.org/copyleft/gpl.html GPL
-    * @author     ConsÃ³rcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-    * @sponsor    Caixa EconÃŽmica Federal
-    * @author     Adriano Coutinho da Silva
-    * @return     Lista dos ultimos 10 eventos do usuÃ¡rio
-    * @access     public
-    **/
-    function GET($request){
-	$this->secured();
-
-	$calendar = Controller::find( array( 'concept' => 'calendarSignature' ), array('calendar'), array( 'filter' => array( '=', 'user',  Config::me("uidNumber") ) ) );
-
-	
-	
-	
-	if($calendar){
-	    $calendars = array();
-	    $timezones = array();
-
-	    foreach($calendar as $key => $value)
-		array_push($calendars, $value['calendar']);
-
-	    $calendarTimezone = Controller::find( array( 'concept' => 'calendar' ), array('id', 'timezone'), array( 'filter' => array( 'IN', 'id',  $calendars ) ) );
-
-	    foreach($calendarTimezone as $key => $value)
-		$timezones[ $value['id'] ] = $value['timezone'];
-
-
-	    $schedulables = Controller::find( array( 'concept' => 'schedulable' ), false, 
-		    array( 'filter' => array('AND', array('>=','rangeStart', (time() - 86400).'000'), array('<=','rangeEnd', (time() + 2592000).'000') ,array( 'IN', 'calendar', $calendars )), 'deepness' => 2, 'timezones' => $timezones) );
-
-	}
-	
-	$response = new Response($request);
-	$response->code = Response::OK;
-	$response->addHeader('Content-type', 'aplication/json');
-
-	$response->body = json_encode(( isset($schedulables) && $schedulables) ?  $schedulables : array());
-	return $response;
-    }
-}
-
-?>
