Changeset 5888 for sandbox/2.4-expresso-api/prototype
- Timestamp:
- 04/05/12 17:00:04 (12 years ago)
- Location:
- sandbox/2.4-expresso-api
- Files:
-
- 237 added
- 10 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4-expresso-api
- Property svn:ignore
-
old new 2 2 header.inc.php 3 3 ._header.inc.php 4 .htaccess.swp
-
- Property svn:ignore
-
sandbox/2.4-expresso-api/prototype/api
-
Property
svn:ignore
set to
.datalayer.js.kate-swp
-
Property
svn:ignore
set to
-
sandbox/2.4-expresso-api/prototype/api/config.php
r5764 r5888 20 20 21 21 static function me($config) 22 { 23 22 { 24 23 return isset($_SESSION['wallet']['user'][$config]) ? $_SESSION['wallet']['user'][$config] : false; 25 24 } -
sandbox/2.4-expresso-api/prototype/api/datalayer.js
r5724 r5888 221 221 222 222 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 223 297 }, 224 298 … … 1991 2065 1992 2066 if( !this.dispatchPath ) 1993 this.dispatchPath = " ../../";2067 this.dispatchPath = "prototype/"; 1994 2068 1995 2069 if( !this.templatePath ) … … 2006 2080 2007 2081 this.start(); 2082 this.me = this.dispatch( "me" ); 2008 2083 } 2009 2084 } -
sandbox/2.4-expresso-api/prototype/config/OpenLDAP.srv
r5534 r5888 5 5 host = 127.0.0.1 6 6 7 ;context = dc=exemplo.com 8 ;user = 9 ;password = 7 context = "dc=prognus" 8 user = "cn=admin,dc=prognus" 9 password = "prognus" -
sandbox/2.4-expresso-api/prototype/config/PostgreSQL.srv
r5534 r5888 3 3 [config] 4 4 port = 5432 5 dbname= expresso 5 dbname= expresso24cristianoAPI 6 6 user=postgres 7 host = /var/run/postgresql 8 ;conexão via tcp 7 host = /tmp 9 8 ;host = 127.0.0.1 10 9 -
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 1 service = PostgreSQL 2 PostgreSQL.concept = clients 32 3 33 4 [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 5 client_id = client_id 6 client_secret = client_secret 7 redirect_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 1 service = PostgreSQL 2 PostgreSQL.concept = auth_codes 32 3 33 4 [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 5 redirect_uri = redirect_uri 6 scope = scope 7 expires = expires 8 code = code 9 client_id = client_id 10 user_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 1 service = PostgreSQL 2 PostgreSQL.concept = refresh_tokens 32 3 33 4 [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 5 refresh_token = refresh_token 6 client_id = client_id 7 user_id = user_id 8 expires = expires 9 scope = scope 10 refresh_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 1 service = PostgreSQL 2 PostgreSQL.concept = access_tokens 32 3 33 4 [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 5 oauth_token = oauth_token 6 client_id = client_id 7 user_id = user_id 8 expires = expires 9 scope = scope 10 refresh_token = refresh_token -
sandbox/2.4-expresso-api/prototype/config/user.ini
r5514 r5888 23 23 24 24 [OpenLDAP.after.find] 25 findExternalPaticipants = modules/calendar/interceptors/DBMapping.php25 ;findExternalPaticipants = modules/calendar/interceptors/DBMapping.php 26 26 27 27 [before.update] … … 51 51 phpgwAccountType = phpgwAccountType 52 52 phpgwAccountVisible = phpgwAccountVisible 53 password = userPassword -
sandbox/2.4-expresso-api/prototype/me.php
r5399 r5888 4 4 5 5 $me = Controller::read(array('concept' => 'user', 'service' => 'OpenLDAP' , 'id' => Config::me('uidNumber'))); 6 6 $me['token'] = $_SESSION['oauth']['access_token']; 7 7 echo json_encode( $me ); 8 8 -
sandbox/2.4-expresso-api/prototype/modules/calendar/interceptors/DBMapping.php
r5752 r5888 175 175 $lastExceptions = Controller::find( array( 'concept' => 'repeatOccurrence' ), array("occurrence") , array( 'filter' => array('AND', array( '=', 'repeat', $id ) , array( '=', 'exception', 1 ) ) )); 176 176 177 //Recurepa as exece ções anteriores caso exista177 //Recurepa as execeᅵᅵes anteriores caso exista 178 178 if(isset($lastExceptions) && count($lastExceptions)) 179 179 foreach($lastExceptions as $key => $value) … … 236 236 if( $start || $end ) 237 237 { 238 Controller::begin( array( 'service' => 'PostgreSQL') );238 //Controller::begin( array( 'service' => 'PostgreSQL') ); 239 239 240 240 foreach( $result as $id => $res ) … … 334 334 $u = $result->format('U') * 1000; 335 335 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 ? 337 337 break; 338 338 … … 632 632 $result[$i]['calendar'] = Controller::read( array( 'concept' => 'calendar' , 'id' => $v['calendar']), false, false); 633 633 $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 acls634 //Caso nï¿œo seja o dono da agenda retorna o objeto permission com as acls 635 635 if($result[$i]['isOwner'] == 0){ 636 636 $permission = Controller::find( array( 'concept' => 'calendarToPermission'), false ,array( 'filter' => array('AND', array('=', 'calendar' , $v['calendar']), array('=', 'user', Config::me('uidNumber') ) ) ) ); … … 749 749 ))); 750 750 751 return false; /* Mata o restante da execu ção */751 return false; /* Mata o restante da execuᅵᅵo */ 752 752 } 753 753 … … 786 786 public function createDefaultSignature( &$uri , &$result , &$criteria , $original ){ 787 787 788 //Caso uma busca n ão retorne nenhum resultado e foi buscado pelas assinaturas do usuario logado apenas788 //Caso uma busca nï¿œo retorne nenhum resultado e foi buscado pelas assinaturas do usuario logado apenas 789 789 if(count($result) <= 0 && 790 790 ( $original['criteria']['filter'][0] == '=' && … … 837 837 else 838 838 { 839 //Criaremos uma agenda padr ão839 //Criaremos uma agenda padrï¿œo 840 840 $cal = array('name' => 'Calendario', 841 'description' => 'Calendario Padr ão',841 'description' => 'Calendario Padrï¿œo', 842 842 'timezone' => (date_default_timezone_get()) ? date_default_timezone_get() : 'America/Sao_Paulo', 843 843 'dtstamp' => time().'000' -
sandbox/2.4-expresso-api/prototype/services/OpenLDAP.php
r5441 r5888 19 19 if( isset($criteria["order"]) ) 20 20 ldap_sort( $this->con, $sr, $criteria["order"] ); 21 21 22 22 return self::_formatEntries( ldap_get_entries( $this->con, $sr ) , $map); 23 23 }
Note: See TracChangeset
for help on using the changeset viewer.