die forcefully but gracefully on missing api templates

This commit is contained in:
friendica 2013-01-23 17:07:55 -08:00
parent 759f36e7e8
commit b3b0a9de24
4 changed files with 66 additions and 61 deletions

View File

@ -12,7 +12,7 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php'); require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.1.1592' ); define ( 'FRIENDICA_VERSION', '3.1.1597' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1158 ); define ( 'DB_UPDATE_VERSION', 1158 );

View File

@ -450,6 +450,11 @@
case "xml": case "xml":
$data = array_xmlify($data); $data = array_xmlify($data);
$tpl = get_markup_template("api_".$templatename."_".$type.".tpl"); $tpl = get_markup_template("api_".$templatename."_".$type.".tpl");
if(! $tpl) {
header ("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<status><error>not implemented</error></status>';
killme();
}
$ret = replace_macros($tpl, $data); $ret = replace_macros($tpl, $data);
break; break;
case "json": case "json":

View File

@ -41,7 +41,7 @@ function queue_run(&$argv, &$argc){
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval'))); $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
$r = q("select * from deliverq where 1"); $r = q("select * from deliverq where 1");
if(count($r)) { if($r) {
foreach($r as $rr) { foreach($r as $rr) {
logger('queue: deliverq'); logger('queue: deliverq');
proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']); proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
@ -53,7 +53,7 @@ function queue_run(&$argv, &$argc){
$r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue` $r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue`
LEFT JOIN `contact` ON `queue`.`cid` = `contact`.`id` LEFT JOIN `contact` ON `queue`.`cid` = `contact`.`id`
WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY"); WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
if(count($r)) { if($r) {
foreach($r as $rr) { foreach($r as $rr) {
logger('Removing expired queue item for ' . $rr['name'] . ', uid=' . $rr['uid']); logger('Removing expired queue item for ' . $rr['name'] . ', uid=' . $rr['uid']);
logger('Expired queue data :' . $rr['content'], LOGGER_DATA); logger('Expired queue data :' . $rr['content'], LOGGER_DATA);
@ -73,7 +73,7 @@ function queue_run(&$argv, &$argc){
$r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))"); $r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))");
} }
if(! count($r)){ if(! $r){
return; return;
} }

View File

@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 3.1.1592\n" "Project-Id-Version: 3.1.1597\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-18 10:00-0800\n" "POT-Creation-Date: 2013-01-23 10:00-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -61,7 +61,7 @@ msgstr ""
#: ../../addon/fbpost/fbpost.php:176 #: ../../addon/fbpost/fbpost.php:176
#: ../../addon/dav/friendica/layout.fnk.php:354 #: ../../addon/dav/friendica/layout.fnk.php:354
#: ../../addon/tumblr/tumblr.php:34 ../../include/items.php:3987 #: ../../addon/tumblr/tumblr.php:34 ../../include/items.php:3987
#: ../../index.php:340 ../../addon.old/facebook/facebook.php:510 #: ../../index.php:341 ../../addon.old/facebook/facebook.php:510
#: ../../addon.old/facebook/facebook.php:516 #: ../../addon.old/facebook/facebook.php:516
#: ../../addon.old/fbpost/fbpost.php:159 ../../addon.old/fbpost/fbpost.php:165 #: ../../addon.old/fbpost/fbpost.php:159 ../../addon.old/fbpost/fbpost.php:165
#: ../../addon.old/dav/friendica/layout.fnk.php:354 #: ../../addon.old/dav/friendica/layout.fnk.php:354
@ -242,11 +242,11 @@ msgstr ""
msgid "Help" msgid "Help"
msgstr "" msgstr ""
#: ../../mod/help.php:90 ../../index.php:225 #: ../../mod/help.php:90 ../../index.php:226
msgid "Not Found" msgid "Not Found"
msgstr "" msgstr ""
#: ../../mod/help.php:93 ../../index.php:228 #: ../../mod/help.php:93 ../../index.php:229
msgid "Page not found." msgid "Page not found."
msgstr "" msgstr ""
@ -289,7 +289,7 @@ msgid "link to source"
msgstr "" msgstr ""
#: ../../mod/events.php:358 ../../view/theme/diabook/theme.php:91 #: ../../mod/events.php:358 ../../view/theme/diabook/theme.php:91
#: ../../include/nav.php:52 ../../boot.php:1836 #: ../../include/nav.php:52 ../../boot.php:1857
msgid "Events" msgid "Events"
msgstr "" msgstr ""
@ -348,7 +348,7 @@ msgstr ""
#: ../../mod/events.php:459 ../../mod/directory.php:134 #: ../../mod/events.php:459 ../../mod/directory.php:134
#: ../../addon/forumdirectory/forumdirectory.php:156 #: ../../addon/forumdirectory/forumdirectory.php:156
#: ../../include/event.php:40 ../../include/bb2diaspora.php:415 #: ../../include/event.php:40 ../../include/bb2diaspora.php:415
#: ../../boot.php:1358 #: ../../boot.php:1379
msgid "Location:" msgid "Location:"
msgstr "" msgstr ""
@ -438,7 +438,7 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: ../../mod/photos.php:51 ../../boot.php:1829 #: ../../mod/photos.php:51 ../../boot.php:1850
msgid "Photo Albums" msgid "Photo Albums"
msgstr "" msgstr ""
@ -1432,7 +1432,7 @@ msgid "is interested in:"
msgstr "" msgstr ""
#: ../../mod/match.php:58 ../../mod/suggest.php:59 #: ../../mod/match.php:58 ../../mod/suggest.php:59
#: ../../include/contact_widgets.php:9 ../../boot.php:1296 #: ../../include/contact_widgets.php:9 ../../boot.php:1317
msgid "Connect" msgid "Connect"
msgstr "" msgstr ""
@ -2106,7 +2106,7 @@ msgid ""
"Password reset failed." "Password reset failed."
msgstr "" msgstr ""
#: ../../mod/lostpass.php:84 ../../boot.php:1030 #: ../../mod/lostpass.php:84 ../../boot.php:1051
msgid "Password Reset" msgid "Password Reset"
msgstr "" msgstr ""
@ -2786,7 +2786,7 @@ msgstr ""
msgid "Invalid contact." msgid "Invalid contact."
msgstr "" msgstr ""
#: ../../mod/notes.php:44 ../../boot.php:1843 #: ../../mod/notes.php:44 ../../boot.php:1864
msgid "Personal Notes" msgid "Personal Notes"
msgstr "" msgstr ""
@ -2960,7 +2960,7 @@ msgstr ""
#: ../../mod/newmember.php:32 ../../mod/profperm.php:103 #: ../../mod/newmember.php:32 ../../mod/profperm.php:103
#: ../../view/theme/diabook/theme.php:88 ../../include/profile_advanced.php:7 #: ../../view/theme/diabook/theme.php:88 ../../include/profile_advanced.php:7
#: ../../include/profile_advanced.php:84 ../../include/nav.php:50 #: ../../include/profile_advanced.php:84 ../../include/nav.php:50
#: ../../boot.php:1819 #: ../../boot.php:1840
msgid "Profile" msgid "Profile"
msgstr "" msgstr ""
@ -3131,7 +3131,7 @@ msgstr ""
msgid "Group name changed." msgid "Group name changed."
msgstr "" msgstr ""
#: ../../mod/group.php:72 ../../mod/profperm.php:19 ../../index.php:339 #: ../../mod/group.php:72 ../../mod/profperm.php:19 ../../index.php:340
msgid "Permission denied" msgid "Permission denied"
msgstr "" msgstr ""
@ -3265,7 +3265,7 @@ msgstr ""
msgid "Choose a nickname: " msgid "Choose a nickname: "
msgstr "" msgstr ""
#: ../../mod/register.php:275 ../../include/nav.php:81 ../../boot.php:991 #: ../../mod/register.php:275 ../../include/nav.php:81 ../../boot.php:1012
msgid "Register" msgid "Register"
msgstr "" msgstr ""
@ -3322,7 +3322,7 @@ msgid "Access denied."
msgstr "" msgstr ""
#: ../../mod/fbrowser.php:25 ../../view/theme/diabook/theme.php:90 #: ../../mod/fbrowser.php:25 ../../view/theme/diabook/theme.php:90
#: ../../include/nav.php:51 ../../boot.php:1826 #: ../../include/nav.php:51 ../../boot.php:1847
msgid "Photos" msgid "Photos"
msgstr "" msgstr ""
@ -4259,7 +4259,7 @@ msgstr ""
msgid "FTP Password" msgid "FTP Password"
msgstr "" msgstr ""
#: ../../mod/profile.php:21 ../../boot.php:1204 #: ../../mod/profile.php:21 ../../boot.php:1225
msgid "Requested profile is not available." msgid "Requested profile is not available."
msgstr "" msgstr ""
@ -4666,23 +4666,23 @@ msgstr ""
msgid "Edit/Manage Profiles" msgid "Edit/Manage Profiles"
msgstr "" msgstr ""
#: ../../mod/profiles.php:722 ../../boot.php:1324 #: ../../mod/profiles.php:722 ../../boot.php:1345
msgid "Change profile photo" msgid "Change profile photo"
msgstr "" msgstr ""
#: ../../mod/profiles.php:723 ../../boot.php:1325 #: ../../mod/profiles.php:723 ../../boot.php:1346
msgid "Create New Profile" msgid "Create New Profile"
msgstr "" msgstr ""
#: ../../mod/profiles.php:734 ../../boot.php:1335 #: ../../mod/profiles.php:734 ../../boot.php:1356
msgid "Profile Image" msgid "Profile Image"
msgstr "" msgstr ""
#: ../../mod/profiles.php:736 ../../boot.php:1338 #: ../../mod/profiles.php:736 ../../boot.php:1359
msgid "visible to everybody" msgid "visible to everybody"
msgstr "" msgstr ""
#: ../../mod/profiles.php:737 ../../boot.php:1339 #: ../../mod/profiles.php:737 ../../boot.php:1360
msgid "Edit visibility" msgid "Edit visibility"
msgstr "" msgstr ""
@ -4818,19 +4818,19 @@ msgstr ""
#: ../../mod/directory.php:136 #: ../../mod/directory.php:136
#: ../../addon/forumdirectory/forumdirectory.php:158 #: ../../addon/forumdirectory/forumdirectory.php:158
#: ../../include/profile_advanced.php:17 ../../boot.php:1360 #: ../../include/profile_advanced.php:17 ../../boot.php:1381
msgid "Gender:" msgid "Gender:"
msgstr "" msgstr ""
#: ../../mod/directory.php:138 #: ../../mod/directory.php:138
#: ../../addon/forumdirectory/forumdirectory.php:160 #: ../../addon/forumdirectory/forumdirectory.php:160
#: ../../include/profile_advanced.php:37 ../../boot.php:1363 #: ../../include/profile_advanced.php:37 ../../boot.php:1384
msgid "Status:" msgid "Status:"
msgstr "" msgstr ""
#: ../../mod/directory.php:140 #: ../../mod/directory.php:140
#: ../../addon/forumdirectory/forumdirectory.php:162 #: ../../addon/forumdirectory/forumdirectory.php:162
#: ../../include/profile_advanced.php:48 ../../boot.php:1365 #: ../../include/profile_advanced.php:48 ../../boot.php:1386
msgid "Homepage:" msgid "Homepage:"
msgstr "" msgstr ""
@ -5735,7 +5735,7 @@ msgstr ""
#: ../../addon/communityhome/communityhome.php:28 #: ../../addon/communityhome/communityhome.php:28
#: ../../addon/communityhome/communityhome.php:34 ../../include/nav.php:64 #: ../../addon/communityhome/communityhome.php:34 ../../include/nav.php:64
#: ../../boot.php:1016 ../../addon.old/communityhome/communityhome.php:28 #: ../../boot.php:1037 ../../addon.old/communityhome/communityhome.php:28
#: ../../addon.old/communityhome/communityhome.php:34 #: ../../addon.old/communityhome/communityhome.php:34
#: ../../addon.old/communityhome/twillingham/communityhome.php:28 #: ../../addon.old/communityhome/twillingham/communityhome.php:28
#: ../../addon.old/communityhome/twillingham/communityhome.php:34 #: ../../addon.old/communityhome/twillingham/communityhome.php:34
@ -8718,7 +8718,7 @@ msgstr ""
msgid "Contacts not in any group" msgid "Contacts not in any group"
msgstr "" msgstr ""
#: ../../include/nav.php:46 ../../boot.php:1015 #: ../../include/nav.php:46 ../../boot.php:1036
msgid "Logout" msgid "Logout"
msgstr "" msgstr ""
@ -8726,7 +8726,7 @@ msgstr ""
msgid "End this session" msgid "End this session"
msgstr "" msgstr ""
#: ../../include/nav.php:49 ../../boot.php:1812 #: ../../include/nav.php:49 ../../boot.php:1833
msgid "Status" msgid "Status"
msgstr "" msgstr ""
@ -8818,7 +8818,7 @@ msgstr ""
msgid "Delegations" msgid "Delegations"
msgstr "" msgstr ""
#: ../../include/nav.php:142 ../../boot.php:1318 #: ../../include/nav.php:142 ../../boot.php:1339
msgid "Profiles" msgid "Profiles"
msgstr "" msgstr ""
@ -9652,117 +9652,117 @@ msgstr ""
msgid "show fewer" msgid "show fewer"
msgstr "" msgstr ""
#: ../../boot.php:878 #: ../../boot.php:899
#, php-format #, php-format
msgid "Update %s failed. See error logs." msgid "Update %s failed. See error logs."
msgstr "" msgstr ""
#: ../../boot.php:880 #: ../../boot.php:901
#, php-format #, php-format
msgid "Update Error at %s" msgid "Update Error at %s"
msgstr "" msgstr ""
#: ../../boot.php:990 #: ../../boot.php:1011
msgid "Create a New Account" msgid "Create a New Account"
msgstr "" msgstr ""
#: ../../boot.php:1018 #: ../../boot.php:1039
msgid "Nickname or Email address: " msgid "Nickname or Email address: "
msgstr "" msgstr ""
#: ../../boot.php:1019 #: ../../boot.php:1040
msgid "Password: " msgid "Password: "
msgstr "" msgstr ""
#: ../../boot.php:1020 #: ../../boot.php:1041
msgid "Remember me" msgid "Remember me"
msgstr "" msgstr ""
#: ../../boot.php:1023 #: ../../boot.php:1044
msgid "Or login using OpenID: " msgid "Or login using OpenID: "
msgstr "" msgstr ""
#: ../../boot.php:1029 #: ../../boot.php:1050
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" msgstr ""
#: ../../boot.php:1032 #: ../../boot.php:1053
msgid "Website Terms of Service" msgid "Website Terms of Service"
msgstr "" msgstr ""
#: ../../boot.php:1033 #: ../../boot.php:1054
msgid "terms of service" msgid "terms of service"
msgstr "" msgstr ""
#: ../../boot.php:1035 #: ../../boot.php:1056
msgid "Website Privacy Policy" msgid "Website Privacy Policy"
msgstr "" msgstr ""
#: ../../boot.php:1036 #: ../../boot.php:1057
msgid "privacy policy" msgid "privacy policy"
msgstr "" msgstr ""
#: ../../boot.php:1165 #: ../../boot.php:1186
msgid "Requested account is not available." msgid "Requested account is not available."
msgstr "" msgstr ""
#: ../../boot.php:1244 #: ../../boot.php:1265
msgid "Edit profile" msgid "Edit profile"
msgstr "" msgstr ""
#: ../../boot.php:1310 #: ../../boot.php:1331
msgid "Message" msgid "Message"
msgstr "" msgstr ""
#: ../../boot.php:1318 #: ../../boot.php:1339
msgid "Manage/edit profiles" msgid "Manage/edit profiles"
msgstr "" msgstr ""
#: ../../boot.php:1440 ../../boot.php:1526 #: ../../boot.php:1461 ../../boot.php:1547
msgid "g A l F d" msgid "g A l F d"
msgstr "" msgstr ""
#: ../../boot.php:1441 ../../boot.php:1527 #: ../../boot.php:1462 ../../boot.php:1548
msgid "F d" msgid "F d"
msgstr "" msgstr ""
#: ../../boot.php:1486 ../../boot.php:1567 #: ../../boot.php:1507 ../../boot.php:1588
msgid "[today]" msgid "[today]"
msgstr "" msgstr ""
#: ../../boot.php:1498 #: ../../boot.php:1519
msgid "Birthday Reminders" msgid "Birthday Reminders"
msgstr "" msgstr ""
#: ../../boot.php:1499 #: ../../boot.php:1520
msgid "Birthdays this week:" msgid "Birthdays this week:"
msgstr "" msgstr ""
#: ../../boot.php:1560 #: ../../boot.php:1581
msgid "[No description]" msgid "[No description]"
msgstr "" msgstr ""
#: ../../boot.php:1578 #: ../../boot.php:1599
msgid "Event Reminders" msgid "Event Reminders"
msgstr "" msgstr ""
#: ../../boot.php:1579 #: ../../boot.php:1600
msgid "Events this week:" msgid "Events this week:"
msgstr "" msgstr ""
#: ../../boot.php:1815 #: ../../boot.php:1836
msgid "Status Messages and Posts" msgid "Status Messages and Posts"
msgstr "" msgstr ""
#: ../../boot.php:1822 #: ../../boot.php:1843
msgid "Profile Details" msgid "Profile Details"
msgstr "" msgstr ""
#: ../../boot.php:1839 #: ../../boot.php:1860
msgid "Events and Calendar" msgid "Events and Calendar"
msgstr "" msgstr ""
#: ../../boot.php:1846 #: ../../boot.php:1867
msgid "Only You Can See This" msgid "Only You Can See This"
msgstr "" msgstr ""
@ -9770,7 +9770,7 @@ msgstr ""
msgid "via" msgid "via"
msgstr "" msgstr ""
#: ../../index.php:399 #: ../../index.php:400
msgid "toggle mobile" msgid "toggle mobile"
msgstr "" msgstr ""