Ignore:
Timestamp:
04/05/12 17:00:04 (12 years ago)
Author:
cristiano
Message:

Ticket #2598 - implementação base REST + oauth

Location:
sandbox/2.4-expresso-api
Files:
237 added
13 edited
4 copied

Legend:

Unmodified
Added
Removed
  • sandbox/2.4-expresso-api

    • Property svn:ignore
      •  

        old new  
        22header.inc.php 
        33._header.inc.php 
         4.htaccess.swp 
  • sandbox/2.4-expresso-api/.htaccess

    r5419 r5888  
    126126RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC] 
    127127RewriteRule ^.*$ - [F]  
     128RewriteRule ^rest(.*)$ prototype/rest/$1 [QSA,L] 
    128129 
    129130# 
  • sandbox/2.4-expresso-api/home.php

    r5042 r5888  
    9898                echo parse_navbar(); 
    9999        } 
    100         // Default Applications (Home Page)  
    101         $default_apps = Array(                   
    102                         'workflow',                      
    103                         'expressoMail1_2', 
    104                         'calendar', 
    105                         'news_admin' 
    106                 ); 
    107         $sorted_apps = array(); 
    108         $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
    109         @reset($user_apps);      
    110         for($i = 0; $i < count($default_apps);$i++) { 
    111                 if(array_key_exists($default_apps[$i], $user_apps)){ 
    112                         $sorted_apps[] = $default_apps[$i]; 
    113                 }                
    114         } 
    115          
    116         foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
    117                 $sorted_apps[] = $p['name']; 
    118         } 
    119          
    120         $portal_oldvarnames = array('mainscreen_showevents', 'homeShowEvents','homeShowLatest','mainscreen_showmail','mainscreen_showbirthdays','mainscreen_show_new_updated'); 
    121         $done = array(); 
    122         // Display elements, within appropriate table cells      
    123         @reset($sorted_apps); 
    124         $idx = 1; 
    125         echo "<table width='100%' cellpadding=5>"; 
    126         foreach($sorted_apps as $appname) 
    127         { 
    128                 if((int)$done[$appname] == 1 || empty($appname)){ 
    129                         continue; 
    130                 }                
    131                 $varnames = $portal_oldvarnames; 
    132                 $varnames[] = 'homepage_display'; 
    133                 $thisd = 0; 
    134                 $tmp = ''; 
    135                  
    136                 foreach($varnames as $varcheck) 
    137                 { 
    138                                                                          
    139                         /*if($appname == 'expressoMail1_2') { 
    140                                 $tmp = $appname; 
    141                                 $appname = 'expressoMail'; 
    142                         }*/                              
    143100 
    144                         if(array_search($appname, $default_apps) !== False){ 
    145                                 $thisd = 1; 
    146                                 break; 
    147                         } 
    148                         if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
    149                                 $thisd = 1; 
    150                                 break; 
    151                         } 
    152                         else  { 
    153                                 $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
    154                                 if($_thisd > 0) { 
    155                                         $thisd = $_thisd; 
    156                                         break; 
    157                                 } 
    158                         } 
    159                 } 
     101//Inicio         
     102        echo ' 
     103            <link rel="Stylesheet" type="text/css" href="prototype/plugins/jquery/jquery-ui.css" />                                      
     104     
     105            <script type="text/javascript" src="prototype/plugins/jquery/jquery.min.js"></script> 
     106         
     107            <script type="text/javascript" src="prototype/plugins/jquery/jquery-ui.min.js"></script> 
     108            <script type="text/javascript" src="prototype/plugins/jquery/jquery-ui.custom.min.js"></script> 
     109            <script src="prototype/plugins/json2/json2.js" language="javascript"></script> 
     110            <script src="prototype/plugins/ejs/ejs.js" language="javascript"></script> 
     111            <script src="prototype/plugins/store/jquery.store.js" language="javascript"></script> 
     112             
     113            <script src="prototype/api/datalayer.js" language="javascript"></script>     
     114            
     115            <script type="text/javascript" src="prototype/plugins/datejs/date-pt-BR.js"></script> 
     116            <script type="text/javascript" src="prototype/plugins/datejs/sugarpak.js"></script> 
     117            <script type="text/javascript" src="prototype/plugins/datejs/parser.js"></script> 
    160118 
    161                 if($thisd > 0) 
    162                 { 
    163                         if($tmp) { 
    164                 $appname = $tmp; 
    165                                 $tmp = ''; 
    166                         } 
    167                         if($idx == 0) {                          
    168                                 print '<tr>'; 
    169                         } 
    170                         print '<td style="vertical-align:top;" width="45%">'; 
    171                         $GLOBALS['phpgw']->hooks->single('home',$appname);                       
    172                         print '</td>'; 
    173                          
    174                         if($idx == 2){ 
    175                                 $idx = 0; 
    176                                 print '</tr>'; 
    177                         }                        
    178                         $idx++; 
    179                         $neworder[] = $appname; 
    180                 } 
    181                 $done[$appname] = 1; 
    182         } 
    183         print '</table>'; 
     119            <script type="text/javascript" src="prototype/plugins/countdown/jquery.countdown.min.js"></script> 
     120            <script type="text/javascript" src="prototype/plugins/countdown/jquery.countdown-pt-BR.js"></script> 
     121             
     122            <script type="text/javascript" src="prototype/modules/home/js/home.js"></script> 
     123            <link rel="Stylesheet" type="text/css" href="prototype/modules/home/css/home.css" />         
     124        '; 
     125 
     126        echo' 
     127            <tr> 
     128                <td> 
     129                    <div class="portlets" style="width: 100%;"></div> 
     130                <td> 
     131            </tr>'; 
     132 
     133//Fim    
    184134        $GLOBALS['phpgw']->common->phpgw_footer(); 
    185135?> 
  • sandbox/2.4-expresso-api/phpgwapi/templates/default/login_default.php

    r5281 r5888  
    177177                        else 
    178178                                $_POST['login'] = $_POST['user']; 
     179 
     180                        /** 
     181                         * LOGIN OAUTH POR CURL 
     182                         */ 
     183                        $ch = curl_init(); 
     184 
     185                        $param  = 'grant_type=password'; 
     186                        $param .= '&client_id=' . $GLOBALS['oauth']['client_id']; 
     187                        $param .= '&client_secret=' . $GLOBALS['oauth']['client_secret']; 
     188                        $param .= '&username=' . $_POST['user']; 
     189                        $param .= '&password=' . $_POST['passwd']; 
     190 
     191                        // set URL and other appropriate options 
     192                        curl_setopt($ch, CURLOPT_URL, $GLOBALS['oauth']['url_token']); 
     193                        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: */*')); 
     194                        curl_setopt($ch, CURLOPT_POST, TRUE); 
     195                        curl_setopt($ch, CURLOPT_POSTFIELDS, $param); 
     196                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  //configura para nao imprimir a saida na tela 
     197                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);//Passe um nï¿œmero long como parï¿œmetro que contï¿œm o limite de tempo, em segundos, que vocï¿œ permite as funᅵᅵes CURL levar.  
     198 
     199                        // grab URL and pass it to the browser 
     200                        $res = curl_exec($ch); 
     201                         
     202                        // close cURL resource, and free up system resources 
     203                        curl_close($ch); 
     204                        $a = json_decode($res); 
     205         
     206                        if ( isset($a->access_token) ) { 
     207                                $_SESSION['oauth']['access_token'] = $a->access_token; 
     208                                $_SESSION['oauth']['expires_in'] = $a->expires_in; 
     209                                $_SESSION['oauth']['token_type'] = $a->token_type; 
     210                                $_SESSION['oauth']['scope'] = $a->scope; 
     211                                $_SESSION['oauth']['refresh_token'] = $a->refresh_token; 
     212                                 
     213                                 
     214                        } 
     215                        else { 
     216                        } 
     217                        /** 
     218                         * #################### 
     219                         */ 
     220 
    179221                } 
    180222                if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && 
     
    598640        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 
    599641 
    600         // Adiciona código personalizado de outro template 
     642        // Adiciona cï¿œdigo personalizado de outro template 
    601643        // que esteja utilizando o login_default.php 
    602644        if(is_file('.'.$template_dir.'/login.inc.php')) { 
  • sandbox/2.4-expresso-api/prototype/api

    • Property svn:ignore set to
      .datalayer.js.kate-swp
  • sandbox/2.4-expresso-api/prototype/api/config.php

    r5764 r5888  
    2020     
    2121    static function me($config) 
    22     { 
    23          
     22    {    
    2423        return isset($_SESSION['wallet']['user'][$config]) ? $_SESSION['wallet']['user'][$config] : false; 
    2524    } 
  • sandbox/2.4-expresso-api/prototype/api/datalayer.js

    r5724 r5888  
    221221       
    222222          return( result ); 
     223    }, 
     224     
     225    /** 
     226    * This method is used to read resources from the server. 
     227    *  
     228    * @param uri Uri of the resource that gonna be readed. 
     229    * @param callback A function that is called when the resource is loaded successfully. When the parameter is ignored the request is made synchrounsly. 
     230    * @param accept The attribute accept that is used to ask the target format to the server 
     231    * @return The target resource when the callback is ommitted ( made it synchronous ) 
     232    */ 
     233 
     234    read: function( uri, callback, accept ){ 
     235        //return this.send( this.dispatchPath + 'rest' + uri, [ 'get', accept || 'json' ], false, callback ); 
     236        //http://expressodev.prognus.com.br/cristiano/expresso-api/rest/maillast 
     237         
     238        return this.send( ('rest' + uri), [ 'get', accept || 'json' ], true, callback, !!!callback,  
     239        {'beforeSend' : function (xhr){  
     240            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     241        }); 
     242       
     243    }, 
     244 
     245    /** 
     246    * This method is used to create resources from the server. 
     247    *  
     248    * @param uri Uri of the resource that gonna be readed. 
     249    * @param callback A function that is called when the resource is created on the server successfully. When the parameter is ignored the request is made synchrounsly. 
     250    * @param accept The attribute accept that is used to ask the target format to the server. 
     251    * @return The result response of the create from the server when the callback is ommitted ( made it synchronous ) 
     252    */ 
     253     
     254    create: function( uri, data, callback, accept ){ 
     255       
     256        return this.send( this.dispatchPath + 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback,  
     257        {'beforeSend' : function (xhr){  
     258            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     259        }); 
     260       
     261    }, 
     262 
     263    /** 
     264    * This method is used to update resources from the server. 
     265    *  
     266    * @param uri Uri of the resource that gonna be readed. 
     267    * @param callback A function that is called when the resource is update on the server successfully. When the parameter is ignored the request is made synchrounsly. 
     268    * @param accept The attribute accept that is used to ask the target format to the server 
     269    * @return The result response of the update from the server when the callback is ommitted ( made it synchronous ) 
     270    */ 
     271 
     272    update: function( uri, data, callback, accept ){ 
     273       
     274        return this.send( this.dispatchPath + 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback,  
     275        {'beforeSend' : function (xhr){  
     276            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     277        }); 
     278       
     279    }, 
     280 
     281    /** 
     282    * This method is used to delete resources from the server. 
     283    *  
     284    * @param uri Uri of the resource that gonna be readed. 
     285    * @param callback A function that is called when the resource is deleted successfully in the server. When the parameter is ignored the request is made synchrounsly. 
     286    * @param accept The attribute accept that is used to ask the target format to the server 
     287    * @return The result response of the delete from the server when the callback is ommitted ( made it synchronous ) 
     288    */ 
     289 
     290    "delete": function( uri, callback, accept ){ 
     291       
     292        return this.send( this.dispatchPath + 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback,  
     293        {'beforeSend' : function (xhr){  
     294            xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}  
     295        }); 
     296       
    223297    }, 
    224298     
     
    19912065 
    19922066        if( !this.dispatchPath ) 
    1993             this.dispatchPath = "../../"; 
     2067            this.dispatchPath = "prototype/"; 
    19942068 
    19952069        if( !this.templatePath ) 
     
    20062080 
    20072081        this.start(); 
     2082        this.me = this.dispatch( "me" ); 
    20082083    } 
    20092084} 
  • sandbox/2.4-expresso-api/prototype/config/OpenLDAP.srv

    r5534 r5888  
    55host = 127.0.0.1 
    66 
    7 ;context = dc=exemplo.com 
    8 ;user =  
    9 ;password =  
     7context = "dc=prognus" 
     8user = "cn=admin,dc=prognus" 
     9password = "prognus" 
  • sandbox/2.4-expresso-api/prototype/config/PostgreSQL.srv

    r5534 r5888  
    33[config] 
    44port = 5432 
    5 dbname= expresso 
     5dbname= expresso24cristianoAPI 
    66user=postgres 
    7 host = /var/run/postgresql 
    8 ;conexão via tcp 
     7host = /tmp 
    98;host = 127.0.0.1 
    109 
  • sandbox/2.4-expresso-api/prototype/config/oauthCliente.ini

    r5514 r5888  
    1 ; [service] 
    2 ; OpenLDAP = '' 
    3 ; PostgreSQL = external 
    4 ;  
    5 ; [service.conflict] 
    6 ; checkExternal = modules/calendar/interceptors/DBMapping.php 
    7  
    8 service = OpenLDAP 
    9 PostgreSQL.concept = calendar_ex_participant 
    10  
    11 [model.hasMany] 
    12 participants = participant.user 
    13  
    14 [PostgreSQL.before.create] 
    15 insertOwnerLink = modules/calendar/interceptors/DBMapping.php 
    16  
    17 [OpenLDAP.before.create] 
    18 encodeURIUser = modules/calendar/interceptors/DBMapping.php 
    19 encodeCreateConcept = modules/calendar/interceptors/DBMapping.php 
    20  
    21 [OpenLDAP.before.find] 
    22 encodeFindUser = modules/calendar/interceptors/LDAPMapping.php 
    23  
    24 [OpenLDAP.after.find] 
    25 findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 
    26  
    27 [before.update] 
    28 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
    29  
    30 [before.create] 
    31 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
     1service = PostgreSQL 
     2PostgreSQL.concept = clients 
    323 
    334[PostgreSQL.mapping] 
    34 id = id 
    35 name = name 
    36 mail = mail 
    37 owner = owner 
    38  
    39 [OpenLDAP.mapping] 
    40 id = uidNumber 
    41 name = cn 
    42 mail = mail 
    43 uid = uid 
    44 givenName = givenName 
    45 sn = sn 
    46 displayName = displayName 
    47 mailAlternateAddress = mailAlternateAddress 
    48 phpgwAccountStatus = phpgwAccountStatus 
    49 accountStatus = accountStatus 
    50 objectClass = objectClass 
    51 phpgwAccountType = phpgwAccountType 
    52 phpgwAccountVisible = phpgwAccountVisible 
     5client_id = client_id 
     6client_secret = client_secret 
     7redirect_uri = redirect_uri 
  • sandbox/2.4-expresso-api/prototype/config/oauthCode.ini

    r5514 r5888  
    1 ; [service] 
    2 ; OpenLDAP = '' 
    3 ; PostgreSQL = external 
    4 ;  
    5 ; [service.conflict] 
    6 ; checkExternal = modules/calendar/interceptors/DBMapping.php 
    7  
    8 service = OpenLDAP 
    9 PostgreSQL.concept = calendar_ex_participant 
    10  
    11 [model.hasMany] 
    12 participants = participant.user 
    13  
    14 [PostgreSQL.before.create] 
    15 insertOwnerLink = modules/calendar/interceptors/DBMapping.php 
    16  
    17 [OpenLDAP.before.create] 
    18 encodeURIUser = modules/calendar/interceptors/DBMapping.php 
    19 encodeCreateConcept = modules/calendar/interceptors/DBMapping.php 
    20  
    21 [OpenLDAP.before.find] 
    22 encodeFindUser = modules/calendar/interceptors/LDAPMapping.php 
    23  
    24 [OpenLDAP.after.find] 
    25 findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 
    26  
    27 [before.update] 
    28 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
    29  
    30 [before.create] 
    31 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
     1service = PostgreSQL 
     2PostgreSQL.concept = auth_codes 
    323 
    334[PostgreSQL.mapping] 
    34 id = id 
    35 name = name 
    36 mail = mail 
    37 owner = owner 
    38  
    39 [OpenLDAP.mapping] 
    40 id = uidNumber 
    41 name = cn 
    42 mail = mail 
    43 uid = uid 
    44 givenName = givenName 
    45 sn = sn 
    46 displayName = displayName 
    47 mailAlternateAddress = mailAlternateAddress 
    48 phpgwAccountStatus = phpgwAccountStatus 
    49 accountStatus = accountStatus 
    50 objectClass = objectClass 
    51 phpgwAccountType = phpgwAccountType 
    52 phpgwAccountVisible = phpgwAccountVisible 
     5redirect_uri = redirect_uri 
     6scope = scope 
     7expires = expires 
     8code = code 
     9client_id = client_id 
     10user_id = user_id 
  • sandbox/2.4-expresso-api/prototype/config/oauthRefreshToken.ini

    r5514 r5888  
    1 ; [service] 
    2 ; OpenLDAP = '' 
    3 ; PostgreSQL = external 
    4 ;  
    5 ; [service.conflict] 
    6 ; checkExternal = modules/calendar/interceptors/DBMapping.php 
    7  
    8 service = OpenLDAP 
    9 PostgreSQL.concept = calendar_ex_participant 
    10  
    11 [model.hasMany] 
    12 participants = participant.user 
    13  
    14 [PostgreSQL.before.create] 
    15 insertOwnerLink = modules/calendar/interceptors/DBMapping.php 
    16  
    17 [OpenLDAP.before.create] 
    18 encodeURIUser = modules/calendar/interceptors/DBMapping.php 
    19 encodeCreateConcept = modules/calendar/interceptors/DBMapping.php 
    20  
    21 [OpenLDAP.before.find] 
    22 encodeFindUser = modules/calendar/interceptors/LDAPMapping.php 
    23  
    24 [OpenLDAP.after.find] 
    25 findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 
    26  
    27 [before.update] 
    28 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
    29  
    30 [before.create] 
    31 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
     1service = PostgreSQL 
     2PostgreSQL.concept = refresh_tokens 
    323 
    334[PostgreSQL.mapping] 
    34 id = id 
    35 name = name 
    36 mail = mail 
    37 owner = owner 
    38  
    39 [OpenLDAP.mapping] 
    40 id = uidNumber 
    41 name = cn 
    42 mail = mail 
    43 uid = uid 
    44 givenName = givenName 
    45 sn = sn 
    46 displayName = displayName 
    47 mailAlternateAddress = mailAlternateAddress 
    48 phpgwAccountStatus = phpgwAccountStatus 
    49 accountStatus = accountStatus 
    50 objectClass = objectClass 
    51 phpgwAccountType = phpgwAccountType 
    52 phpgwAccountVisible = phpgwAccountVisible 
     5refresh_token = refresh_token 
     6client_id = client_id 
     7user_id = user_id 
     8expires = expires 
     9scope = scope 
     10refresh_token = refresh_token 
  • sandbox/2.4-expresso-api/prototype/config/oauthToken.ini

    r5514 r5888  
    1 ; [service] 
    2 ; OpenLDAP = '' 
    3 ; PostgreSQL = external 
    4 ;  
    5 ; [service.conflict] 
    6 ; checkExternal = modules/calendar/interceptors/DBMapping.php 
    7  
    8 service = OpenLDAP 
    9 PostgreSQL.concept = calendar_ex_participant 
    10  
    11 [model.hasMany] 
    12 participants = participant.user 
    13  
    14 [PostgreSQL.before.create] 
    15 insertOwnerLink = modules/calendar/interceptors/DBMapping.php 
    16  
    17 [OpenLDAP.before.create] 
    18 encodeURIUser = modules/calendar/interceptors/DBMapping.php 
    19 encodeCreateConcept = modules/calendar/interceptors/DBMapping.php 
    20  
    21 [OpenLDAP.before.find] 
    22 encodeFindUser = modules/calendar/interceptors/LDAPMapping.php 
    23  
    24 [OpenLDAP.after.find] 
    25 findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 
    26  
    27 [before.update] 
    28 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
    29  
    30 [before.create] 
    31 encodeServiceUser = modules/calendar/interceptors/DBMapping.php 
     1service = PostgreSQL 
     2PostgreSQL.concept = access_tokens 
    323 
    334[PostgreSQL.mapping] 
    34 id = id 
    35 name = name 
    36 mail = mail 
    37 owner = owner 
    38  
    39 [OpenLDAP.mapping] 
    40 id = uidNumber 
    41 name = cn 
    42 mail = mail 
    43 uid = uid 
    44 givenName = givenName 
    45 sn = sn 
    46 displayName = displayName 
    47 mailAlternateAddress = mailAlternateAddress 
    48 phpgwAccountStatus = phpgwAccountStatus 
    49 accountStatus = accountStatus 
    50 objectClass = objectClass 
    51 phpgwAccountType = phpgwAccountType 
    52 phpgwAccountVisible = phpgwAccountVisible 
     5oauth_token = oauth_token 
     6client_id = client_id 
     7user_id = user_id 
     8expires = expires 
     9scope = scope 
     10refresh_token = refresh_token 
  • sandbox/2.4-expresso-api/prototype/config/user.ini

    r5514 r5888  
    2323 
    2424[OpenLDAP.after.find] 
    25 findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 
     25;findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 
    2626 
    2727[before.update] 
     
    5151phpgwAccountType = phpgwAccountType 
    5252phpgwAccountVisible = phpgwAccountVisible 
     53password = userPassword 
  • sandbox/2.4-expresso-api/prototype/me.php

    r5399 r5888  
    44 
    55$me = Controller::read(array('concept' => 'user', 'service' => 'OpenLDAP'  , 'id' => Config::me('uidNumber'))); 
    6  
     6$me['token'] = $_SESSION['oauth']['access_token'];   
    77echo json_encode( $me ); 
    88 
  • sandbox/2.4-expresso-api/prototype/modules/calendar/interceptors/DBMapping.php

    r5752 r5888  
    175175        $lastExceptions = Controller::find( array( 'concept' => 'repeatOccurrence' ), array("occurrence") , array( 'filter' => array('AND', array( '=', 'repeat', $id ) , array( '=', 'exception', 1 ) ) )); 
    176176 
    177         //Recurepa as execeções anteriores caso exista 
     177        //Recurepa as execeᅵᅵes anteriores caso exista 
    178178        if(isset($lastExceptions) && count($lastExceptions)) 
    179179            foreach($lastExceptions as $key => $value) 
     
    236236        if( $start || $end ) 
    237237        { 
    238             Controller::begin( array( 'service' => 'PostgreSQL') ); 
     238            //Controller::begin( array( 'service' => 'PostgreSQL') ); 
    239239 
    240240            foreach( $result as $id => $res ) 
     
    334334       $u = $result->format('U') * 1000; 
    335335 
    336        if( $u  > $end ) //data da repetição atual maior que a data final da busca do usuario ? 
     336       if( $u  > $end ) //data da repetiᅵᅵo atual maior que a data final da busca do usuario ? 
    337337           break; 
    338338 
     
    632632                    $result[$i]['calendar'] = Controller::read( array( 'concept' => 'calendar' , 'id' => $v['calendar']), false, false);  
    633633                                        $result[$i]['defaultAlarms'] = Controller::find( array( 'concept' => 'calendarSignatureAlarm' ) , false ,array( 'filter' => array('=', 'calendarSignature'  ,  $v['id']) ));     
    634                                         //Caso não seja o dono da agenda retorna o objeto permission com as acls 
     634                                        //Caso nï¿œo seja o dono da agenda retorna o objeto permission com as acls 
    635635                                        if($result[$i]['isOwner'] == 0){ 
    636636                                                $permission = Controller::find( array( 'concept' => 'calendarToPermission'), false ,array( 'filter' => array('AND', array('=', 'calendar' ,  $v['calendar']), array('=', 'user', Config::me('uidNumber') ) ) ) );  
     
    749749                     ))); 
    750750             
    751             return false; /* Mata o restante da execução */ 
     751            return false; /* Mata o restante da execuᅵᅵo */ 
    752752        }  
    753753         
     
    786786    public function createDefaultSignature( &$uri , &$result , &$criteria , $original ){ 
    787787                      
    788     //Caso uma busca não retorne nenhum resultado e foi buscado pelas assinaturas do usuario logado apenas 
     788    //Caso uma busca nï¿œo retorne nenhum resultado e foi buscado pelas assinaturas do usuario logado apenas 
    789789    if(count($result) <= 0 &&  
    790790            ( $original['criteria']['filter'][0] == '=' && 
     
    837837        else 
    838838        { 
    839          //Criaremos uma agenda padrão 
     839         //Criaremos uma agenda padrï¿œo 
    840840          $cal = array('name' => 'Calendario', 
    841                          'description' => 'Calendario Padrão', 
     841                         'description' => 'Calendario Padrï¿œo', 
    842842                         'timezone' =>  (date_default_timezone_get()) ? date_default_timezone_get() : 'America/Sao_Paulo', 
    843843                         'dtstamp' => time().'000' 
  • sandbox/2.4-expresso-api/prototype/services/OpenLDAP.php

    r5441 r5888  
    1919        if( isset($criteria["order"]) ) 
    2020            ldap_sort( $this->con, $sr, $criteria["order"] );  
    21          
     21                 
    2222        return  self::_formatEntries( ldap_get_entries( $this->con, $sr ) , $map); 
    2323    } 
Note: See TracChangeset for help on using the changeset viewer.