Changeset 15918
- Timestamp:
- 04/01/08 17:44:12 (8 months ago)
- Files:
-
- branches/MidCOM_2_8/midcom.admin.user/style/midcom-admin-user-personlist-header.php (modified) (1 diff)
- branches/MidCOM_2_8/midgard.admin.asgard/handler/object/manage.php (modified) (1 diff)
- branches/MidCOM_2_8/midgard.admin.asgard/handler/type.php (modified) (1 diff)
- branches/MidCOM_2_8/midgard.admin.asgard/navigation.php (modified) (1 diff)
- branches/MidCOM_2_8/midgard.admin.asgard/style/midgard_admin_asgard_object_copy.php (modified) (1 diff)
- branches/MidCOM_2_8/midgard.admin.asgard/style/midgard_admin_asgard_object_copytree.php (modified) (1 diff)
- branches/MidCOM_2_8/org.routamc.positioning/cron/fetchfireeagle.php (modified) (1 diff)
- branches/MidCOM_2_8/org.routamc.positioning/exec/test-fireeagle.php (modified) (3 diffs)
- branches/MidCOM_2_8/org.routamc.positioning/importer/fireeagle.php (modified) (1 diff)
- branches/MidCOM_2_8/org.routamc.positioning/lib/fireeagle.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.admin.user/style/midcom-admin-user-personlist-header.php
r15790 r15918 4 4 <input type="text" id="midcom_admin_user_search" name="midcom_admin_user_search" value="<?php if (isset($_REQUEST['midcom_admin_user_search'])) { echo $_REQUEST['midcom_admin_user_search']; } ?>" /> 5 5 </label> 6 <script type="text/javascript">7 document.getElementById('midcom_admin_user_search').focus();8 </script>6 <script type="text/javascript"> 7 document.getElementById('midcom_admin_user_search').focus(); 8 </script> 9 9 <input type="submit" value="<?php echo $_MIDCOM->i18n->get_string('go', 'midcom.admin.user'); ?>" /> 10 10 <div class="helptext"> branches/MidCOM_2_8/midgard.admin.asgard/handler/object/manage.php
r15760 r15918 779 779 $_MIDCOM->relocate("__mfa/asgard/object/{$this->_request_data['default_mode']}/{$this->_object->guid}/{$data['language_code']}"); 780 780 // This will exit. 781 case 'edit':781 case 'edit': 782 782 $qf =& $this->_controller->formmanager->form; 783 783 if(isset($_REQUEST['midcom_helper_datamanager2_save']) && isset($qf->_errors)) branches/MidCOM_2_8/midgard.admin.asgard/handler/type.php
r15789 r15918 243 243 if (isset($_GET['search'])) 244 244 { 245 midgard_admin_asgard_plugin::get_default_mode(&$data);245 midgard_admin_asgard_plugin::get_default_mode(&$data); 246 246 $data['search_results'] = $this->_search($_GET['search']); 247 247 248 //If there is exactly one result, go there directly248 //If there is exactly one result, go there directly 249 249 if (sizeof($data['search_results']) == 1) 250 {250 { 251 251 $_MIDCOM->relocate('__mfa/asgard/object/' . $data['default_mode'] . '/' . $data['search_results'][0]->guid) . '/'; 252 252 //this will exit 253 }253 } 254 254 $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/jQuery/jquery.tablesorter.js'); 255 255 $_MIDCOM->add_link_head branches/MidCOM_2_8/midgard.admin.asgard/navigation.php
r15798 r15918 247 247 echo "<a href=\"{$_MIDGARD['self']}__mfa/asgard/object/{$this->_request_data['default_mode']}/{$object->guid}/\" title=\"GUID: {$object->guid}, ID: {$object->id}\">{$icon}{$label}</a>\n"; 248 248 249 /* If there is exactly one root object, show its children, since250 * this is what the user most likely wants to reach251 */249 /* If there is exactly one root object, show its children, since 250 * this is what the user most likely wants to reach 251 */ 252 252 if ($selected || sizeof($root_objects) == 1) 253 253 { branches/MidCOM_2_8/midgard.admin.asgard/style/midgard_admin_asgard_object_copy.php
r15500 r15918 4 4 $data['controller']->display_form(); 5 5 ?> 6 branches/MidCOM_2_8/midgard.admin.asgard/style/midgard_admin_asgard_object_copytree.php
r15563 r15918 25 25 echo preg_replace('/(<form.*?>)/i', '\1' . $tree_select, $form); 26 26 ?> 27 branches/MidCOM_2_8/org.routamc.positioning/cron/fetchfireeagle.php
r15490 r15918 1 <?php1 <?php 2 2 /** 3 3 * @package org.routamc.positioning branches/MidCOM_2_8/org.routamc.positioning/exec/test-fireeagle.php
r15490 r15918 1 <?php1 <?php 2 2 $_MIDCOM->auth->require_valid_user(); 3 3 … … 17 17 { 18 18 $session = new midcom_service_session('org_routamc_positioning_fireeagle'); 19 if ( isset($_GET['f'])20 && $_GET['f'] == 'start')21 {22 // get a request token + secret from FE and redirect to the authorization page19 if ( isset($_GET['f']) 20 && $_GET['f'] == 'start') 21 { 22 // get a request token + secret from FE and redirect to the authorization page 23 23 $fireeagle = new FireEagle($fireeagle_consumer_key, $fireeagle_consumer_secret); 24 24 $request_token = $fireeagle->getRequestToken(); … … 32 32 33 33 // Save request token to session and redirect user 34 $session->set('auth_state', 'start');35 $session->set('request_token', $request_token['oauth_token']);36 $session->set('request_secret', $request_token['oauth_token_secret']);37 38 ?>39 <p><a href="<?php echo $fireeagle->getAuthorizeURL($request_token['oauth_token']); ?>" target="_blank">Authorize this application</a></p>40 <p><a href="?f=callback">And then click here</a></p>41 <?php34 $session->set('auth_state', 'start'); 35 $session->set('request_token', $request_token['oauth_token']); 36 $session->set('request_secret', $request_token['oauth_token_secret']); 37 38 ?> 39 <p><a href="<?php echo $fireeagle->getAuthorizeURL($request_token['oauth_token']); ?>" target="_blank">Authorize this application</a></p> 40 <p><a href="?f=callback">And then click here</a></p> 41 <?php 42 42 $_MIDCOM->finish(); 43 43 die(); 44 }45 elseif ( isset($_GET['f'])46 && $_GET['f'] == 'callback')44 } 45 elseif ( isset($_GET['f']) 46 && $_GET['f'] == 'callback') 47 47 { 48 // the user has authorized us at FE, so now we can pick up our access token + secret49 if ( !$session->exists('auth_state')50 || $session->get('auth_state') != 'start')51 {52 die("Out of sequence.");53 }48 // the user has authorized us at FE, so now we can pick up our access token + secret 49 if ( !$session->exists('auth_state') 50 || $session->get('auth_state') != 'start') 51 { 52 die("Out of sequence."); 53 } 54 54 55 55 $fireeagle = new FireEagle($fireeagle_consumer_key, $fireeagle_consumer_secret, $session->get('request_token'), $session->get('request_secret')); branches/MidCOM_2_8/org.routamc.positioning/importer/fireeagle.php
r15490 r15918 1 <?php1 <?php 2 2 /** 3 3 * @package org.routamc.positioning branches/MidCOM_2_8/org.routamc.positioning/lib/fireeagle.php
r15587 r15918 74 74 75 75 function __construct($consumerKey, 76 $consumerSecret,77 $oAuthToken = null,78 $oAuthTokenSecret = null) {76 $consumerSecret, 77 $oAuthToken = null, 78 $oAuthTokenSecret = null) { 79 79 $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); 80 80 $this->consumer = new OAuthConsumer($consumerKey, $consumerSecret, NULL); … … 152 152 $r->user->best_guess = NULL; 153 153 foreach ($r->user->location_hierarchy as &$loc) { 154 $c = $loc->geometry->coordinates;155 switch ($loc->geometry->type) {156 case 'Box': // DEPRECATED157 $loc->bbox = $c;158 $loc->latitude = ($c[0][0] + $c[1][0]) / 2;159 $loc->longitude = ($c[0][1] + $c[1][1]) / 2;160 $loc->geotype = 'box';161 break;162 case 'Polygon':163 $loc->bbox = $bbox = $loc->geometry->bbox;164 $loc->latitude = ($bbox[0][0] + $bbox[1][0]) / 2;165 $loc->longitude = ($bbox[0][1] + $bbox[1][1]) / 2;166 $loc->geotype = 'box';167 break;168 case 'Point':169 list($loc->longitude, $loc->latitude) = $c;170 $loc->geotype = 'point';171 break;172 }173 if ($loc->best_guess) $r->user->best_guess = $loc; // add shortcut to get 'best guess' loc174 unset($loc);154 $c = $loc->geometry->coordinates; 155 switch ($loc->geometry->type) { 156 case 'Box': // DEPRECATED 157 $loc->bbox = $c; 158 $loc->latitude = ($c[0][0] + $c[1][0]) / 2; 159 $loc->longitude = ($c[0][1] + $c[1][1]) / 2; 160 $loc->geotype = 'box'; 161 break; 162 case 'Polygon': 163 $loc->bbox = $bbox = $loc->geometry->bbox; 164 $loc->latitude = ($bbox[0][0] + $bbox[1][0]) / 2; 165 $loc->longitude = ($bbox[0][1] + $bbox[1][1]) / 2; 166 $loc->geotype = 'box'; 167 break; 168 case 'Point': 169 list($loc->longitude, $loc->latitude) = $c; 170 $loc->geotype = 'point'; 171 break; 172 } 173 if ($loc->best_guess) $r->user->best_guess = $loc; // add shortcut to get 'best guess' loc 174 unset($loc); 175 175 } 176 176 } … … 254 254 $url_bits = parse_url($url); 255 255 if (isset($postData)) { 256 self::dump("POST ".$url_bits['path']." HTTP/1.0\nHost: ".$url_bits['host']."\nContent-Type: application/x-www-urlencoded\nContent-Length: ".strlen($postData)."\n\n$postData\n");256 self::dump("POST ".$url_bits['path']." HTTP/1.0\nHost: ".$url_bits['host']."\nContent-Type: application/x-www-urlencoded\nContent-Length: ".strlen($postData)."\n\n$postData\n"); 257 257 } else { 258 $get_url = $url_bits['path'];259 if ($url_bits['query']) $get_url .= '?' . $url_bits['query'];260 self::dump("GET $get_url HTTP/1.0\nHost: ".$url_bits['host']."\n\n");258 $get_url = $url_bits['path']; 259 if ($url_bits['query']) $get_url .= '?' . $url_bits['query']; 260 self::dump("GET $get_url HTTP/1.0\nHost: ".$url_bits['host']."\n\n"); 261 261 } 262 262 }
