Changeset 1853
- Timestamp:
- Feb 24, 2007, 12:25:34 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/ws_checker.php
r1824 r1853 50 50 $official = array( /* Requests are limited to */ 51 51 'categories.' /* all categories. methods */ 52 , 'categories.getImages' /* <= see */53 , 'categories.getList' /* <= see */52 , 'categories.getImages' 53 , 'categories.getList' 54 54 , 'images.' /* all images. methods */ 55 , 'images.getInfo' /* <= see */ 55 , 'images.getInfo' 56 , 'images.addComment' 57 , 'images.search' 56 58 , 'tags.' /* all tags. methods */ 57 , 'tags.getImages' /* <= see */58 , 'tags.getList' /* <= see */59 , 'tags.getImages' 60 , 'tags.getList' 59 61 ); 60 62 if (function_exists('local_req')) { … … 126 128 127 129 //--------------------------------------------------------- update informations 128 130 $chk_partner = ''; 129 131 // Is a new access required? 130 132 … … 151 153 152 154 pwg_query($query); 155 $chk_partner = $add_partner; 153 156 154 157 $template->assign_block_vars( … … 262 265 { 263 266 $num++; 267 $chk_partner = ( $chk_partner == '' ) ? $row['name'] : $chk_partner; 264 268 $template->assign_block_vars( 265 269 'acc_list.access', … … 346 350 } 347 351 } 352 if ( $chk_partner !== '' ) 353 { 354 $request = get_absolute_root_url().'ws.php?method=pwg.getVersion&format=rest&' 355 . "partner=$chk_partner" ; 356 $session = curl_init($request); 357 curl_setopt ($session, CURLOPT_POST, true); 358 curl_setopt($session, CURLOPT_HEADER, true); 359 curl_setopt($session, CURLOPT_RETURNTRANSFER, true); 360 $response = curl_exec($session); 361 curl_close($session); 362 $status_code = array(); 363 preg_match('/\d\d\d/', $response, $status_code); 364 switch( $status_code[0] ) { 365 case 200: 366 $ws_status = l10n('Web Services under control'); 367 break; 368 case 503: 369 $ws_status = 'PhpWebGallery Web Services failed and returned an ' 370 . 'HTTP status of 503. Service is unavailable. An internal ' 371 . 'problem prevented us from returning data to you.'; 372 break; 373 case 403: 374 $ws_status = 'PhpWebGallery Web Services failed and returned an ' 375 . 'HTTP status of 403. Access is forbidden. You do not have ' 376 . 'permission to access this resource, or are over ' 377 . 'your rate limit.'; 378 break; 379 case 400: 380 // You may want to fall through here and read the specific XML error 381 $ws_status = 'PhpWebGallery Web Services failed and returned an ' 382 . 'HTTP status of 400. Bad request. The parameters passed ' 383 . 'to the service did not match as expected. The exact ' 384 . 'error is returned in the XML response.'; 385 break; 386 default: 387 $ws_status = 'PhpWebGallery Web Services returned an unexpected HTTP ' 388 . 'status of:' . $status_code[0]; 389 } 390 $template->assign_block_vars( 391 'acc_list.ws_status', 392 array( 393 'VALUE'=> $ws_status, 394 ) 395 ); 396 } 348 397 349 398 //----------------------------------------------------------- sending html code -
trunk/include/config_default.inc.php
r1848 r1853 606 606 $conf['ws_max_images_per_page'] = 500; 607 607 608 // On Access control false 608 // On Access control false / Admim Web Service need Php cURL extension 609 609 // Controls are done on public basis or 610 610 // if connected on member authorization basis -
trunk/include/ws_functions.inc.php
r1852 r1853 60 60 } 61 61 if ( !empty($row['request']) 62 and strpos($methodName, $row['request'])==false ) 63 { 62 and strpos($methodName, $row['request'])==false 63 and strpos($methodName, 'session')==false 64 and strpos($methodName, 'getVersion')==false ) 65 { // session and getVersion are allowed to diagnose any failure reason 64 66 return new PwgError(403, 'Method not allowed'); 65 67 } … … 115 117 // Behind / we could found img-ids, cat-ids or tag-ids 116 118 $target = $row['access']; 119 if ( $target == '') 120 { 121 return '1=1'; // No controls are requested 122 } 117 123 list($type, $str_ids) = explode('/',$target); // Find type list 118 124 -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1831 r1853 538 538 $lang['Add this access definition'] = 'Add this access definition'; 539 539 $lang['Web Services availability duration in days'] = 'Web Services availability duration in days'; 540 $lang['Web Services under control'] = 'PhpWebGallery Web Services are fully operationals and all requests are under control.'; 540 541 $lang['special_admin_menu'] = 'Specials'; 541 542 $lang['pictures_menu'] = 'Pictures'; -
trunk/language/en_UK.iso-8859-1/help/web_service.html
r1746 r1853 36 36 <dd>Images limit count: to return to your partner for each request.</dd> 37 37 38 <dt>Postponed availability </dt>39 40 <dd>Can start in few days from now. Remember Web Service would be available and enable.</dd>41 42 38 <dt>Duration </dt> 43 39 44 40 <dd>From now, set availability in days. If you postpone over the duration, the service would never be available.</dd> 45 46 <dt>High / Normal </dt>47 48 <dd>Result contains description for high resolution picture (pwg_high). Normal size picture as well.49 If both are set to No. Only thumbnail information will be sent to your partner.</dd>50 41 51 42 <dt>Comment </dt> -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1831 r1853 537 537 $lang['Add this access definition']= 'Ajouter cette définition d\'accès'; 538 538 $lang['Web Services availability duration in days'] = 'Durée d\'ouverture des Services Web en jours'; 539 $lang['Web Services under control'] = 'Les Services Web de PhpWebGallery sont totalement operationnels et toutes les requêtes sont contrôlées.'; 539 540 $lang['special_admin_menu'] = 'Spécials'; 540 541 $lang['pictures_menu'] = 'Images'; … … 556 557 $lang['Day'] = 'Jour'; 557 558 $lang['Pages seen'] = 'Pages vues'; 558 //$lang['only'] = 'uniquement';559 $lang['only'] = 'uniquement'; 559 560 $lang['Pictures'] = 'Images'; 560 561 $lang['High quality'] = 'Haute résolution'; -
trunk/language/fr_FR.iso-8859-1/help/web_service.html
r1746 r1853 37 37 <dd>Nombre d'images maximum adressées à votre partenaire à chacune de ses requêtes.</dd> 38 38 39 <dt>Report de disponibilité </dt>40 41 <dd>La disponibilité peut être décalée de quelques jours à compter de cet instant. N'oubliez pas que les Services doivent être autorisés et actifs le jour venu.</dd>42 43 39 <dt>Durée </dt> 44 40 45 41 <dd>A partir de maintenant, indiquez la disponibilité en jours. Si vous reportez la disponibilité au delà de sa durée, le service ne devrait jamais être rendu.</dd> 46 47 <dt>High / Normal </dt>48 49 <dd>Résultat containdra les informations relatives aux images en haute résolution (pwg_high). Les images Normal(es) suivent le même principe.50 Si les deux sont à "Non", seulement les informations des miniatures seront adressées à votre partenaire.</dd>51 42 52 43 <dt>Commentaire </dt> -
trunk/template/yoga/admin.tpl
r1814 r1853 6 6 <ul> 7 7 <li><a href="{U_RETURN}">{lang:home}</a></li> 8 <li><a href="{U_FAQ}">{lang:instructions}</a></li> 8 9 <li><a href="{U_ADMIN}" title="{L_ADMIN_HINT}">{L_ADMIN}</a></li> 9 </ul>10 </dd>11 </dl>12 <dl>13 <dt>{lang:general}</dt>14 <dd>15 <ul>16 <li><a href="{U_FAQ}">{lang:instructions}</a></li>17 <li><a href="{U_SITE_MANAGER}">{lang:Site manager}</a></li>18 <li><a href="{U_CAT_UPDATE}">{lang:update}</a></li>19 <li>20 {lang:history}21 <ul>22 <li><a href="{U_HISTORY_STAT}">{lang:Statistics}</a></li>23 <li><a href="{U_HISTORY_SEARCH}">{lang:Search}</a></li>24 </ul>25 </li>26 10 </ul> 27 11 </dd> … … 38 22 </dl> 39 23 <dl> 40 <dt>{lang:special_admin_menu}</dt>41 <dd>42 <ul>43 <li><a href="{U_MAINTENANCE}">{lang:Maintenance}</a></li>44 <li><a href="{U_ADVANCED_FEATURE}">{lang:Advanced_features}</a></li>45 <li><a href="{U_NOTIFICATION_BY_MAIL}">{lang:nbm_item_notification}</a></li>46 <!-- BEGIN web_services -->47 <li><a href="{web_services.U_WS_CHECKER}">{lang:web_services}</a></li>48 <!-- END web_services -->49 </ul>50 </dd>51 </dl>52 <dl>53 24 <dt>{lang:Categories}</dt> 54 25 <dd> 55 26 <ul> 27 <li><a href="{U_SITE_MANAGER}">{lang:Site manager}</a></li> 28 <li><a href="{U_CAT_UPDATE}">{lang:update}</a><br /> </li> 56 29 <li><a href="{U_CATEGORIES}">{lang:manage}</a></li> 57 30 <li><a href="{U_MOVE}">{lang:Move}</a></li> … … 74 47 <li><a href="{U_COMMENTS}">{lang:comments}</a></li> 75 48 <li><a href="{U_RATING}">{lang:Rating}</a></li> 49 <li><a href="{U_TAGS}">{lang:Tags}</a></li> 76 50 <li><a href="{U_CADDIE}">{lang:Caddie}</a></li> 77 <li><a href="{U_TAGS}">{lang:Tags}</a></li>78 51 </ul> 79 52 </dd> … … 85 58 <li><a href="{U_USERS}">{lang:users}</a></li> 86 59 <li><a href="{U_GROUPS}">{lang:groups}</a></li> 60 <li><a href="{U_NOTIFICATION_BY_MAIL}">{lang:nbm_item_notification}</a></li> 87 61 </ul> 88 62 </dd> 89 63 </dl> 90 64 <dl> 91 <dt>{lang: Plugins}</dt>65 <dt>{lang:special_admin_menu}</dt> 92 66 <dd> 93 67 <ul> 68 <li> 69 {lang:history} 70 <ul> 71 <li><a href="{U_HISTORY_STAT}">{lang:Statistics}</a></li> 72 <li><a href="{U_HISTORY_SEARCH}">{lang:Search}</a></li> 73 </ul> 74 </li> 75 <li><a href="{U_MAINTENANCE}">{lang:Maintenance}</a></li> 76 <li><a href="{U_ADVANCED_FEATURE}">{lang:Advanced_features}</a></li> 77 <!-- BEGIN web_services --> 78 <li><a href="{web_services.U_WS_CHECKER}">{lang:web_services}</a></li> 79 <!-- END web_services --> 80 <li> 81 {lang:Plugins} 82 <ul> 94 83 <!-- BEGIN plugin_menu --> 95 84 <!-- BEGIN menu_item --> … … 97 86 <!-- END menu_item --> 98 87 <!-- END plugin_menu --> 88 </ul> 89 </li> 99 90 </ul> 100 91 </dd> -
trunk/template/yoga/admin/ws_checker.tpl
r1833 r1853 224 224 </fieldset> 225 225 </form> 226 <!-- BEGIN ws_status --> 227 <h3>{acc_list.ws_status.VALUE}</h3> 228 <!-- END ws_status --> 226 229 <!-- END acc_list -->
Note: See TracChangeset
for help on using the changeset viewer.