From adc2fc18a58353aa28e6c9d1c262318566c709f7 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 28 Apr 2012 01:25:55 +0100 Subject: [PATCH 01/41] Added "important changes" to admin menu for admins who don't follow the github properly. --- view/admin_aside.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/view/admin_aside.tpl b/view/admin_aside.tpl index 4bf7ce9d3a..a3c98e2ce4 100644 --- a/view/admin_aside.tpl +++ b/view/admin_aside.tpl @@ -20,6 +20,7 @@ From 3bfa3f2a13f4e3b75b8e922eb3d946e1a31809b6 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 21:02:57 -0400 Subject: [PATCH 03/41] fix #search-text Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 3 +-- view/theme/dispy/dark/style.less | 8 +++----- view/theme/dispy/light/style.css | 3 +-- view/theme/dispy/light/style.less | 8 +++----- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 26a21bcf1a..de4f3a6dc6 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -73,8 +73,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm #nav-buttons{clear:both;list-style:none;padding:0px;margin:0px;height:25px;}#nav-buttons>li{padding:0;display:inline-block;margin:0px -4px 0px 0px;} .floaterflip{display:block;position:fixed;z-index:110;top:56px;right:19px;width:22px;height:22px;overflow:hidden;margin:0px;background:transparent url(dark/icons.png) -190px -60px no-repeat;} .search-box{display:inline-block;margin:5px;position:fixed;right:0px;bottom:0px;z-index:100;background:#1d1f1d;border-radius:5px;} -#search-text{border:1px #eec solid;background:#2e2f2e;color:#eec;} -.search-box #search-text{margin:8px;width:10em;height:14px;color:#eec;} +#search-text{border:1px #eec solid;background:#2e2f2e;color:#eec;font-size:8pt;margin:8px;width:10em;height:14px;} #scrollup{position:fixed;right:5px;bottom:40px;z-index:100;}#scrollup a:hover{text-decoration:none;border:0;} #user-menu{box-shadow:5px 0 10px 0 #111;display:block;width:75%;margin:3px 0 0 0;position:relative;background-color:#555753;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background:#555753 url("dark/menu-user-pin.jpg") 98% center no-repeat;clear:both;top:4px;left:10px;padding:2px;}#user-menu>a{vertical-align:top;} #user-menu-label{font-size:12px;padding:3px 20px 9px 5px;height:10px;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index c56adf5a18..41fd2c8aa2 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -477,13 +477,11 @@ nav #nav-notifications-linkmenu { #search-text { border: 1px #eec solid; background: #2e2f2e; - color: #eec; } - -.search-box #search-text { + color: #eec; + font-size: 8pt; margin: 8px; width: 10em; - height: 14px; - color: #eec; } + height: 14px; } #scrollup { position: fixed; diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index 2c95d70da9..8fc48a80fd 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -73,8 +73,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm #nav-buttons{clear:both;list-style:none;padding:0px;margin:0px;height:25px;}#nav-buttons>li{padding:0;display:inline-block;margin:0px -4px 0px 0px;} .floaterflip{display:block;position:fixed;z-index:110;top:56px;right:19px;width:22px;height:22px;overflow:hidden;margin:0px;background:transparent url(light/icons.png) -190px -60px no-repeat;} .search-box{display:inline-block;margin:5px;position:fixed;right:0px;bottom:0px;z-index:100;background:#1d1f1d;border-radius:5px;} -#search-text{border:1px #eec solid;background:#2e3436;color:#eec;} -.search-box #search-text{margin:8px;width:10em;height:14px;color:#eec;} +#search-text{border:1px #eec solid;background:#2e3436;color:#eec;font-size:8pt;margin:8px;width:10em;height:14px;} #scrollup{position:fixed;right:5px;bottom:40px;z-index:100;}#scrollup a:hover{text-decoration:none;border:0;} #user-menu{box-shadow:5px 0 10px 0 #111;display:block;width:75%;margin:3px 0 0 0;position:relative;background-color:#555753;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background:#555753 url("light/menu-user-pin.jpg") 98% center no-repeat;clear:both;top:4px;left:10px;padding:2px;}#user-menu>a{vertical-align:top;} #user-menu-label{font-size:12px;padding:3px 20px 9px 5px;height:10px;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index 18151bc270..57b40351be 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -478,13 +478,11 @@ nav #nav-notifications-linkmenu { #search-text { border: 1px #eec solid; background: #2e3436; - color: #eec; } - -.search-box #search-text { + color: #eec; + font-size: 8pt; margin: 8px; width: 10em; - height: 14px; - color: #eec; } + height: 14px; } #scrollup { position: fixed; From 4b553de79f8f7b134c71093181dc262cc4a63b67 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 28 Apr 2012 03:01:27 +0100 Subject: [PATCH 04/41] Diabook-dark update, it's almost useable now (if you're lenient). --- view/theme/diabook/diabook-dark/style-network.css | 10 +++++----- view/theme/diabook/diabook-dark/style-profile.css | 12 +++++++----- view/theme/diabook/diabook-dark/style.css | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/view/theme/diabook/diabook-dark/style-network.css b/view/theme/diabook/diabook-dark/style-network.css index 6ff44748f7..8a7083d9d4 100644 --- a/view/theme/diabook/diabook-dark/style-network.css +++ b/view/theme/diabook/diabook-dark/style-network.css @@ -1431,7 +1431,7 @@ transition: all 0.2s ease-in-out; .wall-item-comment-wrapper { margin: 1px 5px 5px 80px; - background-color: #fff; + background-color: #444; width: 500px; } .wall-item-comment-wrapper .comment-edit-photo { @@ -1442,14 +1442,14 @@ transition: all 0.2s ease-in-out; width: 100%; font-size: 10px; color: #999999; - border: 1px solid #DDD; + border: 1px solid #2e2e2f; padding: 0.3em; font-size: 14px; } .wall-item-comment-wrapper .comment-edit-text-full { font-size: 14px; height: 4em; - color: #2e2f2e; + color: #eec; border: 1px solid #2e2f2e; } .comment-edit-preview { @@ -1596,8 +1596,8 @@ transition: all 0.2s ease-in-out; height: 2.0em; width: 99%; font-size: 15px; - color: #999999; - border: 1px solid #DDD; + color: #eec; + border: 1px solid #444; padding: 0.3em; margin-bottom: 10px; } diff --git a/view/theme/diabook/diabook-dark/style-profile.css b/view/theme/diabook/diabook-dark/style-profile.css index b052b77ff4..3ecad85af5 100644 --- a/view/theme/diabook/diabook-dark/style-profile.css +++ b/view/theme/diabook/diabook-dark/style-profile.css @@ -540,7 +540,7 @@ header #banner a:active, header #banner a:visited, header #banner a:link, header #banner a:hover { - color: #2e2f2e; + color: #eec; text-decoration: none; outline: none; vertical-align: middle; @@ -661,7 +661,7 @@ nav .nav-menu-icon { border-radius: 5px 5px 0 0; } nav .nav-menu-icon:hover { - background-color: #eec; + background-color: #308dbf; position: relative; height: 22px; padding: 5px; @@ -776,7 +776,7 @@ nav #nav-apps-link.selected { } .notify-seen { - background: none repeat scroll 0 0 #DDDDDD; + background: none repeat scroll 0 0 #666; } ul.menu-popup { @@ -1424,7 +1424,7 @@ transition: all 0.2s ease-in-out; .wall-item-comment-wrapper .comment-edit-text-full { font-size: 14px; height: 4em; - color: #2e302; + color: #eec; border: 1px solid #2e302; } .comment-edit-preview { @@ -1571,10 +1571,11 @@ transition: all 0.2s ease-in-out; height: 2.0em; width: 99%; font-size: 15px; - color: #999999; + color: #eec; border: 1px solid #DDD; padding: 0.3em; margin-bottom: 10px; + background: #444; } .grey { @@ -1667,6 +1668,7 @@ transition: all 0.2s ease-in-out; margin: 0 0 5px; width: 60%; border: 1px solid #d2d2d2; + background: #444; } #profile-jot-form #jot-title:-webkit-input-placeholder { font-weight: normal; diff --git a/view/theme/diabook/diabook-dark/style.css b/view/theme/diabook/diabook-dark/style.css index 638aeb4558..b59ab5dc15 100644 --- a/view/theme/diabook/diabook-dark/style.css +++ b/view/theme/diabook/diabook-dark/style.css @@ -1671,6 +1671,7 @@ body .pageheader{ height: 2.0em; width: 100%; font-size: 10px; + background: #444; color: #999999; border: 1px solid #DDD; padding: 0.3em; From 39d0926d09b28a70ba70a66c0b29f9ea51a8f9a0 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 27 Apr 2012 19:39:19 -0700 Subject: [PATCH 05/41] PRIVACY: if wall is blocked, don't provide public keywords in HTML meta --- mod/profile.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/profile.php b/mod/profile.php index de1e272489..e9d4ca344e 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -32,6 +32,8 @@ function profile_init(&$a) { profile_load($a,$which,$profile); + $userblock = (($a->profile['hidewall'] && (! local_user()) && (! remote_user())) ? true : false); + if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) { $a->page['htmlhead'] .= ''; } @@ -41,8 +43,8 @@ function profile_init(&$a) { $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']); $a->page['htmlhead'] .= '' . "\r\n"; } - - if(! $blocked) { + // site block + if((! $blocked) && (! $userblock)) { $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : ''); $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords); if(strlen($keywords)) From 3bb06cc3e4fa808df3a4b9fbe85d30c7390c4955 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 27 Apr 2012 19:47:52 -0700 Subject: [PATCH 06/41] add tooltip title to common_tabs --- view/common_tabs.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/common_tabs.tpl b/view/common_tabs.tpl index 146ad29fa0..22c33d6b1f 100644 --- a/view/common_tabs.tpl +++ b/view/common_tabs.tpl @@ -1,5 +1,5 @@ From f163aed66d2aec038131131c68110043de36137a Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 27 Apr 2012 23:17:40 -0700 Subject: [PATCH 07/41] break up poller into separate processes --- include/onepoll.php | 519 ++++++++++++++++++++++++++++++++++++++++++++ include/poller.php | 437 +------------------------------------ mod/admin.php | 4 +- view/admin_site.tpl | 1 + 4 files changed, 529 insertions(+), 432 deletions(-) create mode 100644 include/onepoll.php diff --git a/include/onepoll.php b/include/onepoll.php new file mode 100644 index 0000000000..4ae34664f3 --- /dev/null +++ b/include/onepoll.php @@ -0,0 +1,519 @@ +set_baseurl(get_config('system','url')); + + load_hooks(); + + logger('onepoll: start'); + + $abandon_days = intval(get_config('system','account_abandon_days')); + if($abandon_days < 1) + $abandon_days = 0; + + + $manual_id = 0; + $generation = 0; + $hub_update = false; + $force = false; + $restart = false; + + if(($argc > 1) && (intval($argv[1]))) + $contact_id = intval($argv[1]); + + if(! $contact_id) { + logger('onepoll: no contact'); + return; + } + + $d = datetime_convert(); + + // Only poll from those with suitable relationships, + // and which have a polling address and ignore Diaspora since + // we are unable to match those posts with a Diaspora GUID and prevent duplicates. + + $abandon_sql = (($abandon_days) + ? sprintf(" AND `user`.`login_date` > UTC_TIMESTAMP() - INTERVAL %d DAY ", intval($abandon_days)) + : '' + ); + + $contacts = q("SELECT `contact`.* FROM `contact` + WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' + AND NOT `network` IN ( '%s', '%s' ) + AND `contact`.`id` = %d + AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0 + AND `contact`.`archive` = 0 LIMIT 1", + intval(CONTACT_IS_SHARING), + intval(CONTACT_IS_FRIEND), + dbesc(NETWORK_DIASPORA), + dbesc(NETWORK_FACEBOOK), + intval($contact_id) + ); + + if(! count($contacts)) { + return; + } + + $contact = $contacts[0]; + + + $xml = false; + + $t = $contact['last-update']; + + if($contact['subhub']) { + $interval = get_config('system','pushpoll_frequency'); + $contact['priority'] = (($interval !== false) ? intval($interval) : 3); + $hub_update = false; + + if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) + $hub_update = true; + } + else + $hub_update = false; + + + $importer_uid = $contact['uid']; + + $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1", + intval($importer_uid) + ); + if(! count($r)) + continue; + + $importer = $r[0]; + + logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['name']}, CONTACT: {$contact['name']}"); + + $last_update = (($contact['last-update'] === '0000-00-00 00:00:00') + ? datetime_convert('UTC','UTC','now - 7 days', ATOM_TIME) + : datetime_convert('UTC','UTC',$contact['last-update'], ATOM_TIME) + ); + + if($contact['network'] === NETWORK_DFRN) { + + $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']); + if(intval($contact['duplex']) && $contact['dfrn-id']) + $idtosend = '0:' . $orig_id; + if(intval($contact['duplex']) && $contact['issued-id']) + $idtosend = '1:' . $orig_id; + + // they have permission to write to us. We already filtered this in the contact query. + $perm = 'rw'; + + $url = $contact['poll'] . '?dfrn_id=' . $idtosend + . '&dfrn_version=' . DFRN_PROTOCOL_VERSION + . '&type=data&last_update=' . $last_update + . '&perm=' . $perm ; + + $handshake_xml = fetch_url($url); + + logger('onepoll: handshake with url ' . $url . ' returns xml: ' . $handshake_xml, LOGGER_DATA); + + + if(! $handshake_xml) { + logger("poller: $url appears to be dead - marking for death "); + // dead connection - might be a transient event, or this might + // mean the software was uninstalled or the domain expired. + // Will keep trying for one month. + mark_for_death($contact); + + // set the last-update so we don't keep polling + $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($contact['id']) + ); + + continue; + } + + if(! strstr($handshake_xml,'status) == 1) { + logger("poller: $url replied status 1 - marking for death "); + + // we may not be friends anymore. Will keep trying for one month. + // set the last-update so we don't keep polling + + + $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($contact['id']) + ); + mark_for_death($contact); + } + else { + if($contact['term-date'] != '0000-00-00 00:00:00') { + logger("poller: $url back from the dead - removing mark for death"); + unmark_for_death($contact); + } + } + + if((intval($res->status) != 0) || (! strlen($res->challenge)) || (! strlen($res->dfrn_id))) + continue; + + if(((float) $res->dfrn_version > 2.21) && ($contact['poco'] == '')) { + q("update contact set poco = '%s' where id = %d limit 1", + dbesc(str_replace('/profile/','/poco/', $contact['url'])), + intval($contact['id']) + ); + } + + $postvars = array(); + + $sent_dfrn_id = hex2bin((string) $res->dfrn_id); + $challenge = hex2bin((string) $res->challenge); + + $final_dfrn_id = ''; + + if(($contact['duplex']) && strlen($contact['prvkey'])) { + openssl_private_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['prvkey']); + openssl_private_decrypt($challenge,$postvars['challenge'],$contact['prvkey']); + } + else { + openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']); + openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']); + } + + $final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.')); + + if(strpos($final_dfrn_id,':') == 1) + $final_dfrn_id = substr($final_dfrn_id,2); + + if($final_dfrn_id != $orig_id) { + logger('poller: ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id); + // did not decode properly - cannot trust this site + continue; + } + + $postvars['dfrn_id'] = $idtosend; + $postvars['dfrn_version'] = DFRN_PROTOCOL_VERSION; + $postvars['perm'] = 'rw'; + + $xml = post_url($contact['poll'],$postvars); + + } + elseif(($contact['network'] === NETWORK_OSTATUS) + || ($contact['network'] === NETWORK_DIASPORA) + || ($contact['network'] === NETWORK_FEED) ) { + + // Upgrading DB fields from an older Friendica version + // Will only do this once per notify-enabled OStatus contact + // or if relationship changes + + $stat_writeable = ((($contact['notify']) && ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['rel'] == CONTACT_IS_FRIEND)) ? 1 : 0); + + if($stat_writeable != $contact['writable']) { + q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1", + intval($stat_writeable), + intval($contact['id']) + ); + } + + // Are we allowed to import from this person? + + if($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) + continue; + + $xml = fetch_url($contact['poll']); + } + elseif($contact['network'] === NETWORK_MAIL || $contact['network'] === NETWORK_MAIL2) { + + logger("onepoll: mail: Fetching", LOGGER_DEBUG); + + $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); + if($mail_disabled) + continue; + + logger("onepoll: Mail: Enabled", LOGGER_DEBUG); + + $mbox = null; + $x = q("SELECT `prvkey` FROM `user` WHERE `uid` = %d LIMIT 1", + intval($importer_uid) + ); + $mailconf = q("SELECT * FROM `mailacct` WHERE `server` != '' AND `uid` = %d LIMIT 1", + intval($importer_uid) + ); + if(count($x) && count($mailconf)) { + $mailbox = construct_mailbox_name($mailconf[0]); + $password = ''; + openssl_private_decrypt(hex2bin($mailconf[0]['pass']),$password,$x[0]['prvkey']); + $mbox = email_connect($mailbox,$mailconf[0]['user'],$password); + unset($password); + logger("Mail: Connect"); + if($mbox) { + q("UPDATE `mailacct` SET `last_check` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($mailconf[0]['id']), + intval($importer_uid) + ); + } + } + if($mbox) { + + $msgs = email_poll($mbox,$contact['addr']); + + if(count($msgs)) { + logger("Mail: Parsing ".count($msgs)." mails.", LOGGER_DEBUG); + + foreach($msgs as $msg_uid) { + logger("Mail: Parsing mail ".$msg_uid, LOGGER_DATA); + + $datarray = array(); + $meta = email_msg_meta($mbox,$msg_uid); + $headers = email_msg_headers($mbox,$msg_uid); + + // look for a 'references' header and try and match with a parent item we have locally. + + $raw_refs = ((x($headers,'references')) ? str_replace("\t",'',$headers['references']) : ''); + $datarray['uri'] = msgid2iri(trim($meta->message_id,'<>')); + + if($raw_refs) { + $refs_arr = explode(' ', $raw_refs); + if(count($refs_arr)) { + for($x = 0; $x < count($refs_arr); $x ++) + $refs_arr[$x] = "'" . msgid2iri(str_replace(array('<','>',' '),array('','',''),dbesc($refs_arr[$x]))) . "'"; + } + $qstr = implode(',',$refs_arr); + $r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `uri` IN ( $qstr ) AND `uid` = %d LIMIT 1", + intval($importer_uid) + ); + if(count($r)) + $datarray['parent-uri'] = $r[0]['uri']; + } + + + if(! x($datarray,'parent-uri')) + $datarray['parent-uri'] = $datarray['uri']; + + // Have we seen it before? + $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1", + intval($importer_uid), + dbesc($datarray['uri']) + ); + + if(count($r)) { +// logger("Mail: Seen before ".$msg_uid); + if($meta->deleted && ! $r[0]['deleted']) { + q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($r[0]['id']) + ); + } + switch ($mailconf[0]['action']) { + case 0: + break; + case 1: + logger("Mail: Deleting ".$msg_uid); + imap_delete($mbox, $msg_uid, FT_UID); + break; + case 2: + logger("Mail: Mark as seen ".$msg_uid); + imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); + break; + case 3: + logger("Mail: Moving ".$msg_uid." to ".$mailconf[0]['movetofolder']); + imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); + if ($mailconf[0]['movetofolder'] != "") + imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID); + break; + } + continue; + } + + // Decoding the header + $subject = imap_mime_header_decode($meta->subject); + $datarray['title'] = ""; + foreach($subject as $subpart) + if ($subpart->charset != "default") + $datarray['title'] .= iconv($subpart->charset, 'UTF-8//IGNORE', $subpart->text); + else + $datarray['title'] .= $subpart->text; + + $datarray['title'] = notags(trim($datarray['title'])); + + //$datarray['title'] = notags(trim($meta->subject)); + $datarray['created'] = datetime_convert('UTC','UTC',$meta->date); + + // Is it reply? + $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or + (substr(strtolower($datarray['title']), 0, 3) == "re-") or + (raw_refs != "")); + + $r = email_get_msg($mbox,$msg_uid, $reply); + if(! $r) { + logger("Mail: can't fetch msg ".$msg_uid); + continue; + } + $datarray['body'] = escape_tags($r['body']); + + logger("Mail: Importing ".$msg_uid); + + // some mailing lists have the original author as 'from' - add this sender info to msg body. + // todo: adding a gravatar for the original author would be cool + + if(! stristr($meta->from,$contact['addr'])) { + $from = imap_mime_header_decode($meta->from); + $fromdecoded = ""; + foreach($from as $frompart) + if ($frompart->charset != "default") + $fromdecoded .= iconv($frompart->charset, 'UTF-8//IGNORE', $frompart->text); + else + $fromdecoded .= $frompart->text; + + $datarray['body'] = "[b]".t('From: ') . escape_tags($fromdecoded) . "[/b]\n\n" . $datarray['body']; + } + + $datarray['uid'] = $importer_uid; + $datarray['contact-id'] = $contact['id']; + if($datarray['parent-uri'] === $datarray['uri']) + $datarray['private'] = 1; + if(($contact['network'] === NETWORK_MAIL) && (! get_pconfig($importer_uid,'system','allow_public_email_replies'))) { + $datarray['private'] = 1; + $datarray['allow_cid'] = '<' . $contact['id'] . '>'; + } + $datarray['author-name'] = $contact['name']; + $datarray['author-link'] = 'mailbox'; + $datarray['author-avatar'] = $contact['photo']; + + $stored_item = item_store($datarray); + q("UPDATE `item` SET `last-child` = 0 WHERE `parent-uri` = '%s' AND `uid` = %d", + dbesc($datarray['parent-uri']), + intval($importer_uid) + ); + q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1", + intval($stored_item) + ); + switch ($mailconf[0]['action']) { + case 0: + break; + case 1: + logger("Mail: Deleting ".$msg_uid); + imap_delete($mbox, $msg_uid, FT_UID); + break; + case 2: + logger("Mail: Mark as seen ".$msg_uid); + imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); + break; + case 3: + logger("Mail: Moving ".$msg_uid." to ".$mailconf[0]['movetofolder']); + imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); + if ($mailconf[0]['movetofolder'] != "") + imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID); + break; + } + } + } + imap_close($mbox); + } + } + elseif($contact['network'] === NETWORK_FACEBOOK) { + // This is picked up by the Facebook plugin on a cron hook. + // Ignored here. + } + + if($xml) { + logger('poller: received xml : ' . $xml, LOGGER_DATA); + if(! strstr($xml,' UTC_TIMESTAMP() - INTERVAL 1 DAY", + intval($contact['id']) + ); + } + if(count($r)) { + if(! $r[0]['total']) { + poco_load($contact['id'],$importer_uid,$contact['poco']); + } + } + + return; +} + +if (array_search(__file__,get_included_files())===0){ + onepoll_run($argv,$argc); + killme(); +} diff --git a/include/poller.php b/include/poller.php index 499483d007..0a0e66b865 100644 --- a/include/poller.php +++ b/include/poller.php @@ -113,6 +113,8 @@ function poller_run($argv, $argc){ $force = true; } + $interval = ((get_config('system','delivery_interval') === false) ? 3 : intval(get_config('system','delivery_interval'))); + $sql_extra = (($manual_id) ? " AND `id` = $manual_id " : ""); reload_plugins(); @@ -136,6 +138,7 @@ function poller_run($argv, $argc){ AND NOT `network` IN ( '%s', '%s' ) $sql_extra AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0 + AND `contact`.`archive` = 0 AND `user`.`account_expired` = 0 $abandon_sql ORDER BY RAND()", intval(CONTACT_IS_SHARING), intval(CONTACT_IS_FRIEND), @@ -224,440 +227,12 @@ function poller_run($argv, $argc){ continue; } - // Check to see if we are running out of memory - if so spawn a new process and kill this one - - $avail_memory = return_bytes(ini_get('memory_limit')); - $memused = memory_get_peak_usage(true); - if(intval($avail_memory)) { - if(($memused / $avail_memory) > 0.95) { - if($generation + 1 > 10) { - logger('poller: maximum number of spawns exceeded. Terminating.'); - killme(); - } - logger('poller: memory exceeded. ' . $memused . ' bytes used. Spawning new poll.'); - proc_run('php', 'include/poller.php', 'restart', (string) $generation + 1); - killme(); - } - } - - $importer_uid = $contact['uid']; - - $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1", - intval($importer_uid) - ); - if(! count($r)) - continue; - - $importer = $r[0]; - - logger("poller: poll: ({$contact['id']}) IMPORTER: {$importer['name']}, CONTACT: {$contact['name']}"); - - $last_update = (($contact['last-update'] === '0000-00-00 00:00:00') - ? datetime_convert('UTC','UTC','now - 30 days', ATOM_TIME) - : datetime_convert('UTC','UTC',$contact['last-update'], ATOM_TIME) - ); - - if($contact['network'] === NETWORK_DFRN) { - - $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']); - - if(intval($contact['duplex']) && $contact['dfrn-id']) - $idtosend = '0:' . $orig_id; - if(intval($contact['duplex']) && $contact['issued-id']) - $idtosend = '1:' . $orig_id; - - // they have permission to write to us. We already filtered this in the contact query. - $perm = 'rw'; - - $url = $contact['poll'] . '?dfrn_id=' . $idtosend - . '&dfrn_version=' . DFRN_PROTOCOL_VERSION - . '&type=data&last_update=' . $last_update - . '&perm=' . $perm ; - - $handshake_xml = fetch_url($url); - - logger('poller: handshake with url ' . $url . ' returns xml: ' . $handshake_xml, LOGGER_DATA); - - - if(! $handshake_xml) { - logger("poller: $url appears to be dead - marking for death "); - // dead connection - might be a transient event, or this might - // mean the software was uninstalled or the domain expired. - // Will keep trying for one month. - mark_for_death($contact); - - // set the last-update so we don't keep polling - - $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1", - dbesc(datetime_convert()), - intval($contact['id']) - ); - - continue; - } - - if(! strstr($handshake_xml,'status) == 1) { - logger("poller: $url replied status 1 - marking for death "); - - // we may not be friends anymore. Will keep trying for one month. - // set the last-update so we don't keep polling - - $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1", - dbesc(datetime_convert()), - intval($contact['id']) - ); - - mark_for_death($contact); - } - else { - if($contact['term-date'] != '0000-00-00 00:00:00') { - logger("poller: $url back from the dead - removing mark for death"); - unmark_for_death($contact); - } - } - - if((intval($res->status) != 0) || (! strlen($res->challenge)) || (! strlen($res->dfrn_id))) - continue; - - if(((float) $res->dfrn_version > 2.21) && ($contact['poco'] == '')) { - q("update contact set poco = '%s' where id = %d limit 1", - dbesc(str_replace('/profile/','/poco/', $contact['url'])), - intval($contact['id']) - ); - } - - $postvars = array(); - - $sent_dfrn_id = hex2bin((string) $res->dfrn_id); - $challenge = hex2bin((string) $res->challenge); - - $final_dfrn_id = ''; - - if(($contact['duplex']) && strlen($contact['prvkey'])) { - openssl_private_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['prvkey']); - openssl_private_decrypt($challenge,$postvars['challenge'],$contact['prvkey']); - } - else { - openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']); - openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']); - } - - $final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.')); - - if(strpos($final_dfrn_id,':') == 1) - $final_dfrn_id = substr($final_dfrn_id,2); - - if($final_dfrn_id != $orig_id) { - logger('poller: ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id); - // did not decode properly - cannot trust this site - continue; - } - - $postvars['dfrn_id'] = $idtosend; - $postvars['dfrn_version'] = DFRN_PROTOCOL_VERSION; - $postvars['perm'] = 'rw'; - - $xml = post_url($contact['poll'],$postvars); - } - elseif(($contact['network'] === NETWORK_OSTATUS) - || ($contact['network'] === NETWORK_DIASPORA) - || ($contact['network'] === NETWORK_FEED) ) { - - // Upgrading DB fields from an older Friendica version - // Will only do this once per notify-enabled OStatus contact - // or if relationship changes - - $stat_writeable = ((($contact['notify']) && ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['rel'] == CONTACT_IS_FRIEND)) ? 1 : 0); - - if($stat_writeable != $contact['writable']) { - q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1", - intval($stat_writeable), - intval($contact['id']) - ); - } - - // Are we allowed to import from this person? - - if($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) - continue; - - $xml = fetch_url($contact['poll']); - } - elseif($contact['network'] === NETWORK_MAIL || $contact['network'] === NETWORK_MAIL2) { - - logger("Mail: Fetching"); - - $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); - if($mail_disabled) - continue; - - logger("Mail: Enabled"); - - $mbox = null; - $x = q("SELECT `prvkey` FROM `user` WHERE `uid` = %d LIMIT 1", - intval($importer_uid) - ); - $mailconf = q("SELECT * FROM `mailacct` WHERE `server` != '' AND `uid` = %d LIMIT 1", - intval($importer_uid) - ); - if(count($x) && count($mailconf)) { - $mailbox = construct_mailbox_name($mailconf[0]); - $password = ''; - openssl_private_decrypt(hex2bin($mailconf[0]['pass']),$password,$x[0]['prvkey']); - $mbox = email_connect($mailbox,$mailconf[0]['user'],$password); - unset($password); - logger("Mail: Connect"); - if($mbox) { - q("UPDATE `mailacct` SET `last_check` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", - dbesc(datetime_convert()), - intval($mailconf[0]['id']), - intval($importer_uid) - ); - } - } - if($mbox) { - logger("Mail: mbox"); - - $msgs = email_poll($mbox,$contact['addr']); - - if(count($msgs)) { - logger("Mail: Parsing ".count($msgs)." mails."); - - foreach($msgs as $msg_uid) { - logger("Mail: Parsing mail ".$msg_uid); - - $datarray = array(); - $meta = email_msg_meta($mbox,$msg_uid); - $headers = email_msg_headers($mbox,$msg_uid); - - // look for a 'references' header and try and match with a parent item we have locally. - - $raw_refs = ((x($headers,'references')) ? str_replace("\t",'',$headers['references']) : ''); - $datarray['uri'] = msgid2iri(trim($meta->message_id,'<>')); - - if($raw_refs) { - $refs_arr = explode(' ', $raw_refs); - if(count($refs_arr)) { - for($x = 0; $x < count($refs_arr); $x ++) - $refs_arr[$x] = "'" . msgid2iri(str_replace(array('<','>',' '),array('','',''),dbesc($refs_arr[$x]))) . "'"; - } - $qstr = implode(',',$refs_arr); - $r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `uri` IN ( $qstr ) AND `uid` = %d LIMIT 1", - intval($importer_uid) - ); - if(count($r)) - $datarray['parent-uri'] = $r[0]['uri']; - } - - - if(! x($datarray,'parent-uri')) - $datarray['parent-uri'] = $datarray['uri']; - - // Have we seen it before? - $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1", - intval($importer_uid), - dbesc($datarray['uri']) - ); - - if(count($r)) { - logger("Mail: Seen before ".$msg_uid); - if($meta->deleted && ! $r[0]['deleted']) { - q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", - dbesc(datetime_convert()), - intval($r[0]['id']) - ); - } - switch ($mailconf[0]['action']) { - case 0: - break; - case 1: - logger("Mail: Deleting ".$msg_uid); - imap_delete($mbox, $msg_uid, FT_UID); - break; - case 2: - logger("Mail: Mark as seen ".$msg_uid); - imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); - break; - case 3: - logger("Mail: Moving ".$msg_uid." to ".$mailconf[0]['movetofolder']); - imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); - if ($mailconf[0]['movetofolder'] != "") - imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID); - break; - } - continue; - } - - // Decoding the header - $subject = imap_mime_header_decode($meta->subject); - $datarray['title'] = ""; - foreach($subject as $subpart) - if ($subpart->charset != "default") - $datarray['title'] .= iconv($subpart->charset, 'UTF-8//IGNORE', $subpart->text); - else - $datarray['title'] .= $subpart->text; - - $datarray['title'] = notags(trim($datarray['title'])); - - //$datarray['title'] = notags(trim($meta->subject)); - $datarray['created'] = datetime_convert('UTC','UTC',$meta->date); - - // Is it reply? - $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or - (substr(strtolower($datarray['title']), 0, 3) == "re-") or - (raw_refs != "")); - - $r = email_get_msg($mbox,$msg_uid, $reply); - if(! $r) { - logger("Mail: can't fetch msg ".$msg_uid); - continue; - } - $datarray['body'] = escape_tags($r['body']); - - logger("Mail: Importing ".$msg_uid); - - // some mailing lists have the original author as 'from' - add this sender info to msg body. - // todo: adding a gravatar for the original author would be cool - - if(! stristr($meta->from,$contact['addr'])) { - $from = imap_mime_header_decode($meta->from); - $fromdecoded = ""; - foreach($from as $frompart) - if ($frompart->charset != "default") - $fromdecoded .= iconv($frompart->charset, 'UTF-8//IGNORE', $frompart->text); - else - $fromdecoded .= $frompart->text; - - $datarray['body'] = "[b]".t('From: ') . escape_tags($fromdecoded) . "[/b]\n\n" . $datarray['body']; - } - - $datarray['uid'] = $importer_uid; - $datarray['contact-id'] = $contact['id']; - if($datarray['parent-uri'] === $datarray['uri']) - $datarray['private'] = 1; - if(($contact['network'] === NETWORK_MAIL) && (! get_pconfig($importer_uid,'system','allow_public_email_replies'))) { - $datarray['private'] = 1; - $datarray['allow_cid'] = '<' . $contact['id'] . '>'; - } - $datarray['author-name'] = $contact['name']; - $datarray['author-link'] = 'mailbox'; - $datarray['author-avatar'] = $contact['photo']; - - $stored_item = item_store($datarray); - q("UPDATE `item` SET `last-child` = 0 WHERE `parent-uri` = '%s' AND `uid` = %d", - dbesc($datarray['parent-uri']), - intval($importer_uid) - ); - q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1", - intval($stored_item) - ); - switch ($mailconf[0]['action']) { - case 0: - break; - case 1: - logger("Mail: Deleting ".$msg_uid); - imap_delete($mbox, $msg_uid, FT_UID); - break; - case 2: - logger("Mail: Mark as seen ".$msg_uid); - imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); - break; - case 3: - logger("Mail: Moving ".$msg_uid." to ".$mailconf[0]['movetofolder']); - imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID); - if ($mailconf[0]['movetofolder'] != "") - imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID); - break; - } - } - } - - imap_close($mbox); - } - } - elseif($contact['network'] === NETWORK_FACEBOOK) { - // This is picked up by the Facebook plugin on a cron hook. - // Ignored here. - } - - if($xml) { - logger('poller: received xml : ' . $xml, LOGGER_DATA); - - if(! strstr($xml,' UTC_TIMESTAMP() - INTERVAL 1 DAY", - intval($contact['id']) - ); - } - if(count($r)) { - if(! $r[0]['total']) { - poco_load($contact['id'],$importer_uid,$contact['poco']); - } - } - - // loop - next contact + proc_run('php','include/onepoll.php',$contact['id']); + if($interval) + @time_sleep_until(microtime(true) + (float) $interval); } } - return; } diff --git a/mod/admin.php b/mod/admin.php index cdc45c8e38..3b6d186d55 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -235,6 +235,7 @@ function admin_page_site_post(&$a){ $proxyuser = ((x($_POST,'proxyuser')) ? notags(trim($_POST['proxyuser'])) : ''); $proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : ''); $timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60); + $delivery_interval = ((x($_POST,'delivery_interval'))? intval(trim($_POST['delivery_interval'])) : 0); $dfrn_only = ((x($_POST,'dfrn_only')) ? True : False); $ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False); $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); @@ -281,7 +282,7 @@ function admin_page_site_post(&$a){ } } set_config('system','ssl_policy',$ssl_policy); - + set_config('system','delivery_interval',$delivery_interval); set_config('config','sitename',$sitename); if ($banner==""){ // don't know why, but del_config doesn't work... @@ -425,6 +426,7 @@ function admin_page_site(&$a) { '$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""), '$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""), '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")), + '$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")), '$form_security_token' => get_form_security_token("admin_site"), diff --git a/view/admin_site.tpl b/view/admin_site.tpl index 2b9db9f357..852a2c0bf2 100644 --- a/view/admin_site.tpl +++ b/view/admin_site.tpl @@ -80,6 +80,7 @@ {{ inc field_input.tpl with $field=$proxy }}{{ endinc }} {{ inc field_input.tpl with $field=$proxyuser }}{{ endinc }} {{ inc field_input.tpl with $field=$timeout }}{{ endinc }} + {{ inc field_input.tpl with $field=$delivery_interval }}{{ endinc }} {{ inc field_input.tpl with $field=$abandon_days }}{{ endinc }}
From 44700b914da591ff3535358db34d035014611264 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 04:20:38 -0700 Subject: [PATCH 08/41] poller refactor: continue not valid in this context --- include/onepoll.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/onepoll.php b/include/onepoll.php index 4ae34664f3..722ebe846b 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -107,7 +107,7 @@ function onepoll_run($argv, $argc){ intval($importer_uid) ); if(! count($r)) - continue; + return; $importer = $r[0]; From 3f586bb962857e39950adfd747cfc875b7cf1dd0 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sat, 28 Apr 2012 20:15:10 +0200 Subject: [PATCH 09/41] small bugfix. sometimes also avatar pics were rescaled --- view/theme/cleanzero/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/cleanzero/theme.php b/view/theme/cleanzero/theme.php index cc924539e4..c993619973 100644 --- a/view/theme/cleanzero/theme.php +++ b/view/theme/cleanzero/theme.php @@ -108,7 +108,7 @@ $a->page['htmlhead'] .= ' ';} } From 4ff2e9a10358e68f7af90ebf6d50d75d3a6ed284 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 16:54:33 -0700 Subject: [PATCH 10/41] a few more continues that should be returns --- boot.php | 2 +- include/onepoll.php | 14 +-- util/messages.po | 265 +++++++++++++++++++++++--------------------- 3 files changed, 148 insertions(+), 133 deletions(-) diff --git a/boot.php b/boot.php index 02550deb1c..105180c231 100644 --- a/boot.php +++ b/boot.php @@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1325' ); +define ( 'FRIENDICA_VERSION', '2.3.1326' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1139 ); diff --git a/include/onepoll.php b/include/onepoll.php index 722ebe846b..51516d0598 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -152,7 +152,7 @@ function onepoll_run($argv, $argc){ intval($contact['id']) ); - continue; + return; } if(! strstr($handshake_xml,'status) != 0) || (! strlen($res->challenge)) || (! strlen($res->dfrn_id))) - continue; + return; if(((float) $res->dfrn_version > 2.21) && ($contact['poco'] == '')) { q("update contact set poco = '%s' where id = %d limit 1", @@ -221,7 +221,7 @@ function onepoll_run($argv, $argc){ if($final_dfrn_id != $orig_id) { logger('poller: ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id); // did not decode properly - cannot trust this site - continue; + return; } $postvars['dfrn_id'] = $idtosend; @@ -251,7 +251,7 @@ function onepoll_run($argv, $argc){ // Are we allowed to import from this person? if($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) - continue; + return; $xml = fetch_url($contact['poll']); } @@ -261,7 +261,7 @@ function onepoll_run($argv, $argc){ $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); if($mail_disabled) - continue; + return; logger("onepoll: Mail: Enabled", LOGGER_DEBUG); @@ -458,7 +458,7 @@ function onepoll_run($argv, $argc){ dbesc(datetime_convert()), intval($contact['id']) ); - continue; + return; } diff --git a/util/messages.po b/util/messages.po index 031815f6b8..f6e149620b 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2.3.1325\n" +"Project-Id-Version: 2.3.1326\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-04-27 17:18-0700\n" +"POT-Creation-Date: 2012-04-28 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -86,7 +86,7 @@ msgid "Return to contact editor" msgstr "" #: ../../mod/crepair.php:148 ../../mod/settings.php:539 -#: ../../mod/settings.php:565 ../../mod/admin.php:573 ../../mod/admin.php:582 +#: ../../mod/settings.php:565 ../../mod/admin.php:575 ../../mod/admin.php:584 msgid "Name" msgstr "" @@ -130,9 +130,9 @@ msgstr "" #: ../../mod/localtime.php:45 ../../mod/contacts.php:318 #: ../../mod/settings.php:537 ../../mod/settings.php:683 #: ../../mod/settings.php:744 ../../mod/settings.php:935 -#: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/admin.php:392 -#: ../../mod/admin.php:570 ../../mod/admin.php:706 ../../mod/admin.php:905 -#: ../../mod/admin.php:993 ../../mod/profiles.php:498 ../../mod/invite.php:119 +#: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/admin.php:393 +#: ../../mod/admin.php:572 ../../mod/admin.php:708 ../../mod/admin.php:907 +#: ../../mod/admin.php:995 ../../mod/profiles.php:498 ../../mod/invite.php:119 #: ../../addon/facebook/facebook.php:574 ../../addon/yourls/yourls.php:76 #: ../../addon/ljpost/ljpost.php:93 ../../addon/nsfw/nsfw.php:57 #: ../../addon/planets/planets.php:158 @@ -555,7 +555,7 @@ msgid "Preview" msgstr "" #: ../../mod/photos.php:1331 ../../mod/settings.php:600 -#: ../../mod/settings.php:681 ../../mod/group.php:168 ../../mod/admin.php:577 +#: ../../mod/settings.php:681 ../../mod/group.php:168 ../../mod/admin.php:579 #: ../../include/conversation.php:318 ../../include/conversation.php:584 msgid "Delete" msgstr "" @@ -1263,7 +1263,7 @@ msgid "if applicable" msgstr "" #: ../../mod/notifications.php:157 ../../mod/notifications.php:204 -#: ../../mod/admin.php:575 +#: ../../mod/admin.php:577 msgid "Approve" msgstr "" @@ -1464,12 +1464,12 @@ msgid "View all contacts" msgstr "" #: ../../mod/contacts.php:290 ../../mod/contacts.php:343 -#: ../../mod/admin.php:579 +#: ../../mod/admin.php:581 msgid "Unblock" msgstr "" #: ../../mod/contacts.php:290 ../../mod/contacts.php:343 -#: ../../mod/admin.php:578 +#: ../../mod/admin.php:580 msgid "Block" msgstr "" @@ -1546,7 +1546,7 @@ msgstr "" msgid "Update public posts" msgstr "" -#: ../../mod/contacts.php:340 ../../mod/admin.php:1051 +#: ../../mod/contacts.php:340 ../../mod/admin.php:1053 msgid "Update now" msgstr "" @@ -1729,7 +1729,7 @@ msgstr "" msgid "Remove account" msgstr "" -#: ../../mod/settings.php:88 ../../mod/admin.php:665 ../../mod/admin.php:870 +#: ../../mod/settings.php:88 ../../mod/admin.php:667 ../../mod/admin.php:872 #: ../../addon/mathjax/mathjax.php:36 ../../include/nav.php:137 msgid "Settings" msgstr "" @@ -1957,7 +1957,7 @@ msgstr "" msgid "Don't show emoticons" msgstr "" -#: ../../mod/settings.php:816 ../../mod/admin.php:173 ../../mod/admin.php:551 +#: ../../mod/settings.php:816 ../../mod/admin.php:173 ../../mod/admin.php:553 msgid "Normal Account" msgstr "" @@ -1965,7 +1965,7 @@ msgstr "" msgid "This account is a normal personal profile" msgstr "" -#: ../../mod/settings.php:820 ../../mod/admin.php:174 ../../mod/admin.php:552 +#: ../../mod/settings.php:820 ../../mod/admin.php:174 ../../mod/admin.php:554 msgid "Soapbox Account" msgstr "" @@ -1973,7 +1973,7 @@ msgstr "" msgid "Automatically approve all connection/friend requests as read-only fans" msgstr "" -#: ../../mod/settings.php:824 ../../mod/admin.php:175 ../../mod/admin.php:553 +#: ../../mod/settings.php:824 ../../mod/admin.php:175 ../../mod/admin.php:555 msgid "Community/Celebrity Account" msgstr "" @@ -1981,7 +1981,7 @@ msgstr "" msgid "Automatically approve all connection/friend requests as read-write fans" msgstr "" -#: ../../mod/settings.php:828 ../../mod/admin.php:176 ../../mod/admin.php:554 +#: ../../mod/settings.php:828 ../../mod/admin.php:176 ../../mod/admin.php:556 msgid "Automatic Friend Account" msgstr "" @@ -2679,7 +2679,7 @@ msgstr "" msgid "Your invitation ID: " msgstr "" -#: ../../mod/register.php:553 ../../mod/admin.php:393 +#: ../../mod/register.php:553 ../../mod/admin.php:394 msgid "Registration" msgstr "" @@ -2735,7 +2735,7 @@ msgid "%1$s doesn't like %2$s's %3$s" msgstr "" #: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:149 -#: ../../mod/admin.php:614 ../../mod/admin.php:813 ../../mod/display.php:37 +#: ../../mod/admin.php:616 ../../mod/admin.php:815 ../../mod/display.php:37 #: ../../mod/display.php:142 ../../include/items.php:3083 msgid "Item not found." msgstr "" @@ -2966,23 +2966,23 @@ msgstr "" msgid "Theme settings updated." msgstr "" -#: ../../mod/admin.php:93 ../../mod/admin.php:391 +#: ../../mod/admin.php:93 ../../mod/admin.php:392 msgid "Site" msgstr "" -#: ../../mod/admin.php:94 ../../mod/admin.php:569 ../../mod/admin.php:581 +#: ../../mod/admin.php:94 ../../mod/admin.php:571 ../../mod/admin.php:583 msgid "Users" msgstr "" -#: ../../mod/admin.php:95 ../../mod/admin.php:663 ../../mod/admin.php:705 +#: ../../mod/admin.php:95 ../../mod/admin.php:665 ../../mod/admin.php:707 msgid "Plugins" msgstr "" -#: ../../mod/admin.php:96 ../../mod/admin.php:868 ../../mod/admin.php:904 +#: ../../mod/admin.php:96 ../../mod/admin.php:870 ../../mod/admin.php:906 msgid "Themes" msgstr "" -#: ../../mod/admin.php:111 ../../mod/admin.php:992 +#: ../../mod/admin.php:111 ../../mod/admin.php:994 msgid "Logs" msgstr "" @@ -2990,9 +2990,9 @@ msgstr "" msgid "User registrations waiting for confirmation" msgstr "" -#: ../../mod/admin.php:188 ../../mod/admin.php:390 ../../mod/admin.php:568 -#: ../../mod/admin.php:662 ../../mod/admin.php:704 ../../mod/admin.php:867 -#: ../../mod/admin.php:903 ../../mod/admin.php:991 +#: ../../mod/admin.php:188 ../../mod/admin.php:391 ../../mod/admin.php:570 +#: ../../mod/admin.php:664 ../../mod/admin.php:706 ../../mod/admin.php:869 +#: ../../mod/admin.php:905 ../../mod/admin.php:993 msgid "Administration" msgstr "" @@ -3016,427 +3016,438 @@ msgstr "" msgid "Active plugins" msgstr "" -#: ../../mod/admin.php:329 +#: ../../mod/admin.php:330 msgid "Site settings updated." msgstr "" -#: ../../mod/admin.php:377 +#: ../../mod/admin.php:378 msgid "Closed" msgstr "" -#: ../../mod/admin.php:378 +#: ../../mod/admin.php:379 msgid "Requires approval" msgstr "" -#: ../../mod/admin.php:379 +#: ../../mod/admin.php:380 msgid "Open" msgstr "" -#: ../../mod/admin.php:383 +#: ../../mod/admin.php:384 msgid "No SSL policy, links will track page SSL state" msgstr "" -#: ../../mod/admin.php:384 +#: ../../mod/admin.php:385 msgid "Force all links to use SSL" msgstr "" -#: ../../mod/admin.php:385 +#: ../../mod/admin.php:386 msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgstr "" -#: ../../mod/admin.php:394 +#: ../../mod/admin.php:395 msgid "File upload" msgstr "" -#: ../../mod/admin.php:395 +#: ../../mod/admin.php:396 msgid "Policies" msgstr "" -#: ../../mod/admin.php:396 +#: ../../mod/admin.php:397 msgid "Advanced" msgstr "" -#: ../../mod/admin.php:400 ../../addon/statusnet/statusnet.php:544 +#: ../../mod/admin.php:401 ../../addon/statusnet/statusnet.php:544 msgid "Site name" msgstr "" -#: ../../mod/admin.php:401 +#: ../../mod/admin.php:402 msgid "Banner/Logo" msgstr "" -#: ../../mod/admin.php:402 +#: ../../mod/admin.php:403 msgid "System language" msgstr "" -#: ../../mod/admin.php:403 +#: ../../mod/admin.php:404 msgid "System theme" msgstr "" -#: ../../mod/admin.php:403 +#: ../../mod/admin.php:404 msgid "" "Default system theme - may be over-ridden by user profiles - change theme settings" msgstr "" -#: ../../mod/admin.php:404 +#: ../../mod/admin.php:405 msgid "SSL link policy" msgstr "" -#: ../../mod/admin.php:404 +#: ../../mod/admin.php:405 msgid "Determines whether generated links should be forced to use SSL" msgstr "" -#: ../../mod/admin.php:405 +#: ../../mod/admin.php:406 msgid "Maximum image size" msgstr "" -#: ../../mod/admin.php:405 +#: ../../mod/admin.php:406 msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " "limits." msgstr "" -#: ../../mod/admin.php:407 +#: ../../mod/admin.php:408 msgid "Register policy" msgstr "" -#: ../../mod/admin.php:408 +#: ../../mod/admin.php:409 msgid "Register text" msgstr "" -#: ../../mod/admin.php:408 +#: ../../mod/admin.php:409 msgid "Will be displayed prominently on the registration page." msgstr "" -#: ../../mod/admin.php:409 +#: ../../mod/admin.php:410 msgid "Accounts abandoned after x days" msgstr "" -#: ../../mod/admin.php:409 +#: ../../mod/admin.php:410 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "" -#: ../../mod/admin.php:410 +#: ../../mod/admin.php:411 msgid "Allowed friend domains" msgstr "" -#: ../../mod/admin.php:410 +#: ../../mod/admin.php:411 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "" -#: ../../mod/admin.php:411 +#: ../../mod/admin.php:412 msgid "Allowed email domains" msgstr "" -#: ../../mod/admin.php:411 +#: ../../mod/admin.php:412 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "" -#: ../../mod/admin.php:412 +#: ../../mod/admin.php:413 msgid "Block public" msgstr "" -#: ../../mod/admin.php:412 +#: ../../mod/admin.php:413 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "" -#: ../../mod/admin.php:413 +#: ../../mod/admin.php:414 msgid "Force publish" msgstr "" -#: ../../mod/admin.php:413 +#: ../../mod/admin.php:414 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "" -#: ../../mod/admin.php:414 +#: ../../mod/admin.php:415 msgid "Global directory update URL" msgstr "" -#: ../../mod/admin.php:414 +#: ../../mod/admin.php:415 msgid "" "URL to update the global directory. If this is not set, the global directory " "is completely unavailable to the application." msgstr "" -#: ../../mod/admin.php:416 +#: ../../mod/admin.php:417 msgid "Block multiple registrations" msgstr "" -#: ../../mod/admin.php:416 +#: ../../mod/admin.php:417 msgid "Disallow users to register additional accounts for use as pages." msgstr "" -#: ../../mod/admin.php:417 +#: ../../mod/admin.php:418 msgid "OpenID support" msgstr "" -#: ../../mod/admin.php:417 +#: ../../mod/admin.php:418 msgid "OpenID support for registration and logins." msgstr "" -#: ../../mod/admin.php:418 +#: ../../mod/admin.php:419 msgid "Fullname check" msgstr "" -#: ../../mod/admin.php:418 +#: ../../mod/admin.php:419 msgid "" "Force users to register with a space between firstname and lastname in Full " "name, as an antispam measure" msgstr "" -#: ../../mod/admin.php:419 +#: ../../mod/admin.php:420 msgid "UTF-8 Regular expressions" msgstr "" -#: ../../mod/admin.php:419 +#: ../../mod/admin.php:420 msgid "Use PHP UTF8 regular expressions" msgstr "" -#: ../../mod/admin.php:420 +#: ../../mod/admin.php:421 msgid "Show Community Page" msgstr "" -#: ../../mod/admin.php:420 +#: ../../mod/admin.php:421 msgid "" "Display a Community page showing all recent public postings on this site." msgstr "" -#: ../../mod/admin.php:421 +#: ../../mod/admin.php:422 msgid "Enable OStatus support" msgstr "" -#: ../../mod/admin.php:421 +#: ../../mod/admin.php:422 msgid "" "Provide built-in OStatus (identi.ca, status.net, etc.) compatibility. All " "communications in OStatus are public, so privacy warnings will be " "occasionally displayed." msgstr "" -#: ../../mod/admin.php:422 +#: ../../mod/admin.php:423 msgid "Enable Diaspora support" msgstr "" -#: ../../mod/admin.php:422 +#: ../../mod/admin.php:423 msgid "Provide built-in Diaspora network compatibility." msgstr "" -#: ../../mod/admin.php:423 +#: ../../mod/admin.php:424 msgid "Only allow Friendica contacts" msgstr "" -#: ../../mod/admin.php:423 +#: ../../mod/admin.php:424 msgid "" "All contacts must use Friendica protocols. All other built-in communication " "protocols disabled." msgstr "" -#: ../../mod/admin.php:424 +#: ../../mod/admin.php:425 msgid "Verify SSL" msgstr "" -#: ../../mod/admin.php:424 +#: ../../mod/admin.php:425 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you " "cannot connect (at all) to self-signed SSL sites." msgstr "" -#: ../../mod/admin.php:425 +#: ../../mod/admin.php:426 msgid "Proxy user" msgstr "" -#: ../../mod/admin.php:426 +#: ../../mod/admin.php:427 msgid "Proxy URL" msgstr "" -#: ../../mod/admin.php:427 +#: ../../mod/admin.php:428 msgid "Network timeout" msgstr "" -#: ../../mod/admin.php:427 +#: ../../mod/admin.php:428 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "" -#: ../../mod/admin.php:453 +#: ../../mod/admin.php:429 +msgid "Delivery interval" +msgstr "" + +#: ../../mod/admin.php:429 +msgid "" +"Delay background delivery processes by this many seconds to reduce system " +"load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 " +"for large dedicated servers." +msgstr "" + +#: ../../mod/admin.php:455 #, php-format msgid "%s user blocked/unblocked" msgid_plural "%s users blocked/unblocked" msgstr[0] "" msgstr[1] "" -#: ../../mod/admin.php:460 +#: ../../mod/admin.php:462 #, php-format msgid "%s user deleted" msgid_plural "%s users deleted" msgstr[0] "" msgstr[1] "" -#: ../../mod/admin.php:499 +#: ../../mod/admin.php:501 #, php-format msgid "User '%s' deleted" msgstr "" -#: ../../mod/admin.php:507 +#: ../../mod/admin.php:509 #, php-format msgid "User '%s' unblocked" msgstr "" -#: ../../mod/admin.php:507 +#: ../../mod/admin.php:509 #, php-format msgid "User '%s' blocked" msgstr "" -#: ../../mod/admin.php:571 +#: ../../mod/admin.php:573 msgid "select all" msgstr "" -#: ../../mod/admin.php:572 +#: ../../mod/admin.php:574 msgid "User registrations waiting for confirm" msgstr "" -#: ../../mod/admin.php:573 +#: ../../mod/admin.php:575 msgid "Request date" msgstr "" -#: ../../mod/admin.php:573 ../../mod/admin.php:582 +#: ../../mod/admin.php:575 ../../mod/admin.php:584 #: ../../include/contact_selectors.php:79 msgid "Email" msgstr "" -#: ../../mod/admin.php:574 +#: ../../mod/admin.php:576 msgid "No registrations." msgstr "" -#: ../../mod/admin.php:576 +#: ../../mod/admin.php:578 msgid "Deny" msgstr "" -#: ../../mod/admin.php:582 +#: ../../mod/admin.php:584 msgid "Register date" msgstr "" -#: ../../mod/admin.php:582 +#: ../../mod/admin.php:584 msgid "Last login" msgstr "" -#: ../../mod/admin.php:582 +#: ../../mod/admin.php:584 msgid "Last item" msgstr "" -#: ../../mod/admin.php:582 +#: ../../mod/admin.php:584 msgid "Account" msgstr "" -#: ../../mod/admin.php:584 +#: ../../mod/admin.php:586 msgid "" "Selected users will be deleted!\\n\\nEverything these users had posted on " "this site will be permanently deleted!\\n\\nAre you sure?" msgstr "" -#: ../../mod/admin.php:585 +#: ../../mod/admin.php:587 msgid "" "The user {0} will be deleted!\\n\\nEverything this user has posted on this " "site will be permanently deleted!\\n\\nAre you sure?" msgstr "" -#: ../../mod/admin.php:626 +#: ../../mod/admin.php:628 #, php-format msgid "Plugin %s disabled." msgstr "" -#: ../../mod/admin.php:630 +#: ../../mod/admin.php:632 #, php-format msgid "Plugin %s enabled." msgstr "" -#: ../../mod/admin.php:640 ../../mod/admin.php:838 +#: ../../mod/admin.php:642 ../../mod/admin.php:840 msgid "Disable" msgstr "" -#: ../../mod/admin.php:642 ../../mod/admin.php:840 +#: ../../mod/admin.php:644 ../../mod/admin.php:842 msgid "Enable" msgstr "" -#: ../../mod/admin.php:664 ../../mod/admin.php:869 +#: ../../mod/admin.php:666 ../../mod/admin.php:871 msgid "Toggle" msgstr "" -#: ../../mod/admin.php:672 ../../mod/admin.php:879 +#: ../../mod/admin.php:674 ../../mod/admin.php:881 msgid "Author: " msgstr "" -#: ../../mod/admin.php:673 ../../mod/admin.php:880 +#: ../../mod/admin.php:675 ../../mod/admin.php:882 msgid "Maintainer: " msgstr "" -#: ../../mod/admin.php:802 +#: ../../mod/admin.php:804 msgid "No themes found." msgstr "" -#: ../../mod/admin.php:861 +#: ../../mod/admin.php:863 msgid "Screenshot" msgstr "" -#: ../../mod/admin.php:909 +#: ../../mod/admin.php:911 msgid "[Experimental]" msgstr "" -#: ../../mod/admin.php:910 +#: ../../mod/admin.php:912 msgid "[Unsupported]" msgstr "" -#: ../../mod/admin.php:937 +#: ../../mod/admin.php:939 msgid "Log settings updated." msgstr "" -#: ../../mod/admin.php:994 +#: ../../mod/admin.php:996 msgid "Clear" msgstr "" -#: ../../mod/admin.php:1000 +#: ../../mod/admin.php:1002 msgid "Debugging" msgstr "" -#: ../../mod/admin.php:1001 +#: ../../mod/admin.php:1003 msgid "Log file" msgstr "" -#: ../../mod/admin.php:1001 +#: ../../mod/admin.php:1003 msgid "" "Must be writable by web server. Relative to your Friendica top-level " "directory." msgstr "" -#: ../../mod/admin.php:1002 +#: ../../mod/admin.php:1004 msgid "Log level" msgstr "" -#: ../../mod/admin.php:1052 +#: ../../mod/admin.php:1054 msgid "Close" msgstr "" -#: ../../mod/admin.php:1058 +#: ../../mod/admin.php:1060 msgid "FTP Host" msgstr "" -#: ../../mod/admin.php:1059 +#: ../../mod/admin.php:1061 msgid "FTP Path" msgstr "" -#: ../../mod/admin.php:1060 +#: ../../mod/admin.php:1062 msgid "FTP User" msgstr "" -#: ../../mod/admin.php:1061 +#: ../../mod/admin.php:1063 msgid "FTP Password" msgstr "" @@ -3444,11 +3455,11 @@ msgstr "" msgid "Requested profile is not available." msgstr "" -#: ../../mod/profile.php:124 ../../mod/display.php:75 +#: ../../mod/profile.php:126 ../../mod/display.php:75 msgid "Access to this profile has been restricted." msgstr "" -#: ../../mod/profile.php:145 +#: ../../mod/profile.php:147 msgid "Tips for New Members" msgstr "" @@ -4224,7 +4235,7 @@ msgstr "" #: ../../addon/facebook/facebook.php:715 #, php-format -msgid "Polling Interval (min. %1$s minutes)" +msgid "Polling Interval in minutes (minimum %1$s minutes)" msgstr "" #: ../../addon/facebook/facebook.php:716 @@ -4327,6 +4338,10 @@ msgid_plural "%d people don't like this" msgstr[0] "" msgstr[1] "" +#: ../../addon/widgets/widget_friendheader.php:40 +msgid "Get added to this list!" +msgstr "" + #: ../../addon/widgets/widgets.php:56 msgid "Generate new key" msgstr "" @@ -6355,7 +6370,7 @@ msgstr "" msgid "%1$d %2$s ago" msgstr "" -#: ../../include/poller.php:543 +#: ../../include/onepoll.php:402 msgid "From: " msgstr "" From 7919d00399e199c34a50f87fd10101d0d8f6f021 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 17:50:28 -0700 Subject: [PATCH 11/41] bring back the email and logging of update failures, but without the transactions --- boot.php | 44 +++++++++++++------------------ view/{ => en}/update_fail_eml.tpl | 0 2 files changed, 19 insertions(+), 25 deletions(-) rename view/{ => en}/update_fail_eml.tpl (100%) diff --git a/boot.php b/boot.php index 105180c231..7564615a5d 100644 --- a/boot.php +++ b/boot.php @@ -658,32 +658,26 @@ if(! function_exists('check_config')) { // call the specific update -// global $db; -// $db->excep(TRUE); -// try { -// $db->beginTransaction(); - $func = 'update_' . $x; - $func($a); -// $db->commit(); -// } catch(Exception $ex) { -// $db->rollback(); -// //send the administrator an e-mail -// $email_tpl = get_intltext_template("update_fail_eml.tpl"); -// $email_tpl = replace_macros($email_tpl, array( -// '$sitename' => $a->config['sitename'], -// '$siteurl' => $a->get_baseurl(), -// '$update' => $x, -// '$error' => $ex->getMessage())); -// $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); + $func = 'update_' . $x; + $retval = $func($a); + if($retval) { + //send the administrator an e-mail + $email_tpl = get_intltext_template("update_fail_eml.tpl"); + $email_tpl = replace_macros($email_tpl, array( + '$sitename' => $a->config['sitename'], + '$siteurl' => $a->get_baseurl(), + '$update' => $x, + '$error' => sprintf( t('Update %s failed. See error logs.'), $x) + )); + $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); -// mail($a->config['admin_email'], $subject, $text, -// 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" -// . 'Content-type: text/plain; charset=UTF-8' . "\n" -// . 'Content-transfer-encoding: 8bit' ); -// //try the logger -// logger('update failed: '.$ex->getMessage().EOL); -// } -// $db->excep(FALSE); + mail($a->config['admin_email'], $subject, $text, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + //try the logger + logger('CRITICAL: Update Failed: '. $x); + } } } set_config('system','build', DB_UPDATE_VERSION); diff --git a/view/update_fail_eml.tpl b/view/en/update_fail_eml.tpl similarity index 100% rename from view/update_fail_eml.tpl rename to view/en/update_fail_eml.tpl From 356bd9b04ad5378b19d4aa8b25ccab178491df34 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 17:53:19 -0700 Subject: [PATCH 12/41] some constants for the db update failure possibilities --- boot.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boot.php b/boot.php index 7564615a5d..cfdadcd19b 100644 --- a/boot.php +++ b/boot.php @@ -73,6 +73,14 @@ define ( 'HOOK_HOOK', 0); define ( 'HOOK_FILE', 1); define ( 'HOOK_FUNCTION', 2); +/** + * DB update return values + */ + +define ( 'UPDATE_SUCCESS', 0); +define ( 'UPDATE_FAILED', 1); + + /** * * page/profile types From 3d054341ef3c7598c12b003c0d271910b3349795 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Sun, 29 Apr 2012 04:12:04 +0200 Subject: [PATCH 13/41] diabook-themes: bug/css-fixes --- .../diabook/diabook-aerith/style-wide.css | 5 ++-- view/theme/diabook/diabook-aerith/style.css | 5 ++-- .../theme/diabook/diabook-blue/style-wide.css | 5 ++-- view/theme/diabook/diabook-blue/style.css | 5 ++-- .../diabook-green/style-network-wide.css | 6 ++--- .../diabook/diabook-green/style-network.css | 10 ++++---- .../diabook-green/style-profile-wide.css | 8 +++---- .../diabook/diabook-green/style-profile.css | 8 +++---- .../diabook/diabook-green/style-wide.css | 19 +++++++-------- view/theme/diabook/diabook-green/style.css | 21 +++++++++-------- .../diabook-pink/style-network-wide.css | 8 +++---- .../diabook/diabook-pink/style-network.css | 12 +++++----- .../diabook-pink/style-profile-wide.css | 10 ++++---- .../diabook/diabook-pink/style-profile.css | 10 ++++---- .../theme/diabook/diabook-pink/style-wide.css | 21 +++++++++-------- view/theme/diabook/diabook-pink/style.css | 23 ++++++++++--------- view/theme/diabook/diabook-red/style-wide.css | 5 ++-- view/theme/diabook/diabook-red/style.css | 5 ++-- view/theme/diabook/footer.tpl | 3 +-- view/theme/diabook/nav.tpl | 2 +- view/theme/diabook/style-wide.css | 5 ++-- view/theme/diabook/style.css | 5 ++-- view/theme/diabook/theme.php | 23 ++++++++++++++++--- 23 files changed, 126 insertions(+), 98 deletions(-) diff --git a/view/theme/diabook/diabook-aerith/style-wide.css b/view/theme/diabook/diabook-aerith/style-wide.css index b8ff1fe250..5c263154f1 100644 --- a/view/theme/diabook/diabook-aerith/style-wide.css +++ b/view/theme/diabook/diabook-aerith/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -1014,7 +1015,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1243,7 +1244,7 @@ aside #likes a:hover{ margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/diabook-aerith/style.css b/view/theme/diabook/diabook-aerith/style.css index 01d35b7541..e0f38aff6a 100644 --- a/view/theme/diabook/diabook-aerith/style.css +++ b/view/theme/diabook/diabook-aerith/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -1013,7 +1014,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1241,7 +1242,7 @@ aside #likes a:hover{ margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/diabook-blue/style-wide.css b/view/theme/diabook/diabook-blue/style-wide.css index c8c2033473..189f4d5599 100644 --- a/view/theme/diabook/diabook-blue/style-wide.css +++ b/view/theme/diabook/diabook-blue/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -983,7 +984,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1203,7 +1204,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/diabook-blue/style.css b/view/theme/diabook/diabook-blue/style.css index 7bf7e8eaa7..2b68afc6f5 100644 --- a/view/theme/diabook/diabook-blue/style.css +++ b/view/theme/diabook/diabook-blue/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -982,7 +983,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1201,7 +1202,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/diabook-green/style-network-wide.css b/view/theme/diabook/diabook-green/style-network-wide.css index cc598b9fe4..38e7e7ae05 100644 --- a/view/theme/diabook/diabook-green/style-network-wide.css +++ b/view/theme/diabook/diabook-green/style-network-wide.css @@ -439,7 +439,7 @@ a:hover { clear: both; } .fakelink { - color: #194719; + color: #2c9936; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -1301,7 +1301,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #194719; + color: #2c9936; } /*marker*/ @@ -1840,7 +1840,7 @@ transition: all 0.2s ease-in-out; font-weight: bolder; } .button.creation2 { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-green/style-network.css b/view/theme/diabook/diabook-green/style-network.css index 7865477112..3cd6117e13 100644 --- a/view/theme/diabook/diabook-green/style-network.css +++ b/view/theme/diabook/diabook-green/style-network.css @@ -439,7 +439,7 @@ a:hover { clear: both; } .fakelink { - color: #194719; + color: #2c9936; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -493,7 +493,7 @@ code { float: right; } .tool a { - color: #194719; + color: #2c9936; } .tool a:hover { text-decoration: none; @@ -1297,7 +1297,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #194719; + color: #2c9936; } .wall-item-decor { @@ -1832,7 +1832,7 @@ transition: all 0.2s ease-in-out; font-weight: bolder; } .button.creation2 { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -1964,7 +1964,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-green/style-profile-wide.css b/view/theme/diabook/diabook-green/style-profile-wide.css index 65b7f2ba3f..e7a0fe623a 100644 --- a/view/theme/diabook/diabook-green/style-profile-wide.css +++ b/view/theme/diabook/diabook-green/style-profile-wide.css @@ -440,7 +440,7 @@ a:hover { clear: both; } .fakelink { - color: #194719; + color: #2c9936; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -1276,7 +1276,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #194719; + color: #2c9936; } /*marker*/ @@ -1811,7 +1811,7 @@ transition: all 0.2s ease-in-out; cursor: pointer; } .button.creation2 { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -1945,7 +1945,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-green/style-profile.css b/view/theme/diabook/diabook-green/style-profile.css index dcc7b373a1..051aa9a351 100644 --- a/view/theme/diabook/diabook-green/style-profile.css +++ b/view/theme/diabook/diabook-green/style-profile.css @@ -440,7 +440,7 @@ a:hover { clear: both; } .fakelink { - color: #194719; + color: #2c9936; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -1270,7 +1270,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #194719; + color: #2c9936; } .wall-item-decor { @@ -1801,7 +1801,7 @@ transition: all 0.2s ease-in-out; cursor: pointer; } .button.creation2 { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -1933,7 +1933,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-green/style-wide.css b/view/theme/diabook/diabook-green/style-wide.css index d85ea23a68..d98a6c3256 100644 --- a/view/theme/diabook/diabook-green/style-wide.css +++ b/view/theme/diabook/diabook-green/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -476,7 +477,7 @@ a:hover { clear: both; } .fakelink { - color: #194719; + color: #2c9936; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -614,7 +615,7 @@ header #banner #logo-text { } /* messages */ #message-new { - background: #194719; + background: #2c9936; border: 1px solid #333; width: 150px; } @@ -991,7 +992,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1185,7 +1186,7 @@ aside #side-peoplefind-url { height: auto; } aside #likes a, a:visited, a:link { - color: #194719; + color: #2c9936; text-decoration: none; cursor: pointer; @@ -1220,7 +1221,7 @@ aside #likes a:hover{ margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ @@ -1422,7 +1423,7 @@ body .pageheader{ padding-top: 10px; } .tread-wrapper a{ - color: #194719; + color: #2c9936; } /*marker*/ @@ -2073,7 +2074,7 @@ body .pageheader{ cursor: pointer; } .button.creation2 { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2207,7 +2208,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2225,7 +2226,7 @@ ul.rs_tabs li { clear: both; } ul.rs_tabs li .selected { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-green/style.css b/view/theme/diabook/diabook-green/style.css index c83ddd3972..6a9d8f7d0c 100644 --- a/view/theme/diabook/diabook-green/style.css +++ b/view/theme/diabook/diabook-green/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -477,7 +478,7 @@ a:hover { } /*color*/ .fakelink { - color: #194719; + color: #2c9936; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -550,7 +551,7 @@ code { } /*color*/ .tool a { - color: #194719; + color: #2c9936; } .tool a:hover { text-decoration: none; @@ -617,7 +618,7 @@ header #banner #logo-text { /*color*/ /* messages */ #message-new { - background: #194719; + background: #2c9936; border: 1px solid #333; width: 150px; } @@ -994,7 +995,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1189,7 +1190,7 @@ aside #side-peoplefind-url { } /*color*/ aside #likes a, a:visited, a:link { - color: #194719; + color: #2c9936; text-decoration: none; cursor: pointer; @@ -1224,7 +1225,7 @@ aside #likes a:hover{ margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ @@ -1425,7 +1426,7 @@ body .pageheader{ } /*color*/ .tread-wrapper a{ - color: #194719; + color: #2c9936; } .wall-item-decor { position: absolute; @@ -2071,7 +2072,7 @@ body .pageheader{ } /*color*/ .button.creation2 { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2204,7 +2205,7 @@ ul.tabs li { } /*color*/ ul.tabs li .active { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2223,7 +2224,7 @@ ul.rs_tabs li { } /*color*/ ul.rs_tabs li .selected { - background-color: #194719; + background-color: #2c9936; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-pink/style-network-wide.css b/view/theme/diabook/diabook-pink/style-network-wide.css index 0a83955dfa..4bbab02c7b 100644 --- a/view/theme/diabook/diabook-pink/style-network-wide.css +++ b/view/theme/diabook/diabook-pink/style-network-wide.css @@ -439,7 +439,7 @@ a:hover { clear: both; } .fakelink { - color: #996d73; + color: #D02B55; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -807,7 +807,7 @@ ul.menu-popup a { text-decoration: none; } ul.menu-popup a:hover { - background-color: #996d73; /*bdcdd4;*/ + background-color: #D02B55; /*bdcdd4;*/ color: #fff; } ul.menu-popup .menu-sep { @@ -1301,7 +1301,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #996d73; + color: #D02B55; } /*marker*/ @@ -1840,7 +1840,7 @@ transition: all 0.2s ease-in-out; font-weight: bolder; } .button.creation2 { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-pink/style-network.css b/view/theme/diabook/diabook-pink/style-network.css index 3a4f49877e..3acb608fc7 100644 --- a/view/theme/diabook/diabook-pink/style-network.css +++ b/view/theme/diabook/diabook-pink/style-network.css @@ -439,7 +439,7 @@ a:hover { clear: both; } .fakelink { - color: #996d73; + color: #D02B55; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -493,7 +493,7 @@ code { float: right; } .tool a { - color: #996d73; + color: #D02B55; } .tool a:hover { text-decoration: none; @@ -807,7 +807,7 @@ ul.menu-popup a { text-decoration: none; } ul.menu-popup a:hover { - background-color: #996d73; /*bdcdd4;*/ + background-color: #D02B55; /*bdcdd4;*/ color: #fff; } ul.menu-popup .menu-sep { @@ -1297,7 +1297,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #996d73; + color: #D02B55; } .wall-item-decor { @@ -1832,7 +1832,7 @@ transition: all 0.2s ease-in-out; font-weight: bolder; } .button.creation2 { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -1964,7 +1964,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-pink/style-profile-wide.css b/view/theme/diabook/diabook-pink/style-profile-wide.css index 0805518963..f4b1939ec2 100644 --- a/view/theme/diabook/diabook-pink/style-profile-wide.css +++ b/view/theme/diabook/diabook-pink/style-profile-wide.css @@ -440,7 +440,7 @@ a:hover { clear: both; } .fakelink { - color: #996d73; + color: #D02B55; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -807,7 +807,7 @@ ul.menu-popup a { text-decoration: none; } ul.menu-popup a:hover { - background-color: #996d73; /*bdcdd4;*/ + background-color: #D02B55; /*bdcdd4;*/ color: #fff; } ul.menu-popup .menu-sep { @@ -1276,7 +1276,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #996d73; + color: #D02B55; } /*marker*/ @@ -1811,7 +1811,7 @@ transition: all 0.2s ease-in-out; cursor: pointer; } .button.creation2 { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -1945,7 +1945,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-pink/style-profile.css b/view/theme/diabook/diabook-pink/style-profile.css index 8f37530614..610fffe3af 100644 --- a/view/theme/diabook/diabook-pink/style-profile.css +++ b/view/theme/diabook/diabook-pink/style-profile.css @@ -440,7 +440,7 @@ a:hover { clear: both; } .fakelink { - color: #996d73; + color: #D02B55; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -806,7 +806,7 @@ ul.menu-popup a { text-decoration: none; } ul.menu-popup a:hover { - background-color: #996d73; /*bdcdd4;*/ + background-color: #D02B55; /*bdcdd4;*/ color: #fff; } ul.menu-popup .menu-sep { @@ -1270,7 +1270,7 @@ transition: all 0.2s ease-in-out; padding-top: 10px; } .tread-wrapper a{ - color: #996d73; + color: #D02B55; } .wall-item-decor { @@ -1801,7 +1801,7 @@ transition: all 0.2s ease-in-out; cursor: pointer; } .button.creation2 { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -1933,7 +1933,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-pink/style-wide.css b/view/theme/diabook/diabook-pink/style-wide.css index a51ca49cc2..849566aa01 100644 --- a/view/theme/diabook/diabook-pink/style-wide.css +++ b/view/theme/diabook/diabook-pink/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -476,7 +477,7 @@ a:hover { clear: both; } .fakelink { - color: #996d73; + color: #D02B55; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -614,7 +615,7 @@ header #banner #logo-text { } /* messages */ #message-new { - background: #996d73; + background: #D02B55; border: 1px solid #333; width: 150px; } @@ -943,7 +944,7 @@ ul.menu-popup a { text-decoration: none; } ul.menu-popup a:hover { - background-color: #996d73; /*bdcdd4;*/ + background-color: #D02B55; /*bdcdd4;*/ color: #fff; } ul.menu-popup .menu-sep { @@ -991,7 +992,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1185,7 +1186,7 @@ aside #side-peoplefind-url { height: auto; } aside #likes a, a:visited, a:link { - color: #996d73; + color: #D02B55; text-decoration: none; cursor: pointer; @@ -1220,7 +1221,7 @@ aside #likes a:hover{ margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ @@ -1422,7 +1423,7 @@ body .pageheader{ padding-top: 10px; } .tread-wrapper a{ - color: #996d73; + color: #D02B55; } /*marker*/ @@ -2073,7 +2074,7 @@ body .pageheader{ cursor: pointer; } .button.creation2 { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2207,7 +2208,7 @@ ul.tabs li { margin-left: 5px; } ul.tabs li .active { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2225,7 +2226,7 @@ ul.rs_tabs li { clear: both; } ul.rs_tabs li .selected { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-pink/style.css b/view/theme/diabook/diabook-pink/style.css index 833e81a5f3..798d739794 100644 --- a/view/theme/diabook/diabook-pink/style.css +++ b/view/theme/diabook/diabook-pink/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -477,7 +478,7 @@ a:hover { } /*color*/ .fakelink { - color: #996d73; + color: #D02B55; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -550,7 +551,7 @@ code { } /*color*/ .tool a { - color: #996d73; + color: #D02B55; } .tool a:hover { text-decoration: none; @@ -617,7 +618,7 @@ header #banner #logo-text { /* messages */ /*color*/ #message-new { - background: #996d73; + background: #D02B55; border: 1px solid #333; width: 150px; } @@ -946,7 +947,7 @@ ul.menu-popup a { } /*color*/ ul.menu-popup a:hover { - background-color: #996d73; /*bdcdd4;*/ + background-color: #D02B55; /*bdcdd4;*/ color: #fff; } ul.menu-popup .menu-sep { @@ -994,7 +995,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1189,7 +1190,7 @@ aside #side-peoplefind-url { } /*color*/ aside #likes a, a:visited, a:link { - color: #996d73; + color: #D02B55; text-decoration: none; cursor: pointer; @@ -1224,7 +1225,7 @@ aside #likes a:hover{ margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ @@ -1425,7 +1426,7 @@ body .pageheader{ } /*color*/ .tread-wrapper a{ - color: #996d73; + color: #D02B55; } .wall-item-decor { position: absolute; @@ -2071,7 +2072,7 @@ body .pageheader{ } /*color*/ .button.creation2 { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2204,7 +2205,7 @@ ul.tabs li { } /*color*/ ul.tabs li .active { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; @@ -2223,7 +2224,7 @@ ul.rs_tabs li { } /*color*/ ul.rs_tabs li .selected { - background-color: #996d73; + background-color: #D02B55; border: 1px solid #777777; color: white; border-radius: 3px 3px 3px 3px; diff --git a/view/theme/diabook/diabook-red/style-wide.css b/view/theme/diabook/diabook-red/style-wide.css index 79c5fb1cbe..b9ea238e2e 100644 --- a/view/theme/diabook/diabook-red/style-wide.css +++ b/view/theme/diabook/diabook-red/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -1013,7 +1014,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1232,7 +1233,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/diabook-red/style.css b/view/theme/diabook/diabook-red/style.css index c7cb1586d0..05c802102c 100644 --- a/view/theme/diabook/diabook-red/style.css +++ b/view/theme/diabook/diabook-red/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -1012,7 +1013,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1230,7 +1231,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/footer.tpl b/view/theme/diabook/footer.tpl index 8d3c651621..bae5e10566 100644 --- a/view/theme/diabook/footer.tpl +++ b/view/theme/diabook/footer.tpl @@ -1,4 +1,3 @@ -
-
+ \ No newline at end of file diff --git a/view/theme/diabook/nav.tpl b/view/theme/diabook/nav.tpl index ce27400f64..f611de0043 100644 --- a/view/theme/diabook/nav.tpl +++ b/view/theme/diabook/nav.tpl @@ -136,7 +136,7 @@ - +
$langselector
diff --git a/view/theme/diabook/style-wide.css b/view/theme/diabook/style-wide.css index f8dced3e69..71ed4e4720 100644 --- a/view/theme/diabook/style-wide.css +++ b/view/theme/diabook/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -974,7 +975,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1195,7 +1196,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 9150ea8cf8..e70c72cb2b 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -974,7 +975,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1198,7 +1199,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index c45db9884d..fa0d47ece1 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -3,13 +3,13 @@ /* * Name: Diabook * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu - * Version: (Version: 1.022) + * Version: (Version: 1.023) * Author: */ //print diabook-version for debugging -$diabook_version = "Diabook (Version: 1.022)"; +$diabook_version = "Diabook (Version: 1.023)"; $a->page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages @@ -313,6 +313,20 @@ $autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.autogro $a->page['htmlhead'] .= sprintf('', $autogrowJS); //js scripts + +//check if community_home-plugin is activated and change css +$nametocheck = "communityhome"; +$r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck)); +if(count($r) == "1") { + +$a->page['htmlhead'] .= ' +'; +} + //comment-edit-wrapper on photo_view if ($a->argv[0].$a->argv[2] === "photos"."image"){ @@ -324,7 +338,6 @@ $a->page['htmlhead'] .= ' }); '; - } $a->page['htmlhead'] .= ' @@ -334,6 +347,10 @@ $a->page['htmlhead'] .= ' $("a.lightbox").fancybox(); // Select all links with lightbox class }); +$(document).ready(function() { + var footer_top = $(document).height() - 30; + $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); + }); '; From 920d40acf43adb584a33555bfd73e2e5d5f1ebd0 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Sun, 29 Apr 2012 05:58:23 +0200 Subject: [PATCH 14/41] diabook-themes: small fix --- view/theme/diabook/footer.tpl | 2 +- view/theme/diabook/theme.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/theme/diabook/footer.tpl b/view/theme/diabook/footer.tpl index bae5e10566..25058a7ff7 100644 --- a/view/theme/diabook/footer.tpl +++ b/view/theme/diabook/footer.tpl @@ -1,3 +1,3 @@ -
+ \ No newline at end of file diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index fa0d47ece1..9a1ac0f68a 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -347,7 +347,7 @@ $a->page['htmlhead'] .= ' $("a.lightbox").fancybox(); // Select all links with lightbox class }); -$(document).ready(function() { +$(window).load(function() { var footer_top = $(document).height() - 30; $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); }); From b3a71e4327bbe618dbdd15428a4614f58b4e848c Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 21:35:14 -0700 Subject: [PATCH 15/41] indicate successful updates --- boot.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index cfdadcd19b..616e152f9b 100644 --- a/boot.php +++ b/boot.php @@ -671,7 +671,7 @@ if(! function_exists('check_config')) { if($retval) { //send the administrator an e-mail $email_tpl = get_intltext_template("update_fail_eml.tpl"); - $email_tpl = replace_macros($email_tpl, array( + $email_msg = replace_macros($email_tpl, array( '$sitename' => $a->config['sitename'], '$siteurl' => $a->get_baseurl(), '$update' => $x, @@ -679,13 +679,16 @@ if(! function_exists('check_config')) { )); $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); - mail($a->config['admin_email'], $subject, $text, + mail($a->config['admin_email'], $subject, $email_msg, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit' ); //try the logger logger('CRITICAL: Update Failed: '. $x); } + else + set_config('database','update_' . $x, 'success'); + } } set_config('system','build', DB_UPDATE_VERSION); @@ -727,9 +730,10 @@ if(! function_exists('check_config')) { foreach($installed as $i) { if(! in_array($i['name'],$plugins_arr)) { uninstall_plugin($i['name']); - } - else + } + else { $installed_arr[] = $i['name']; + } } } From 64060f82dc68d490f3d729f3fbe139527c831fd0 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 21:56:17 -0700 Subject: [PATCH 16/41] toggle to archive unfriends, though render them useless --- include/Contact.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/Contact.php b/include/Contact.php index 537850e007..2523fc0231 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -51,6 +51,21 @@ function user_remove($uid) { function contact_remove($id) { + + $r = q("select uid from contact where id = %d limit 1", + intval($id) + ); + if((! count($r)) || (! intval($r[0]['uid']))) + return; + + $archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts'); + if($archive) { + q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d limit 1", + intval($id) + ); + return; + } + q("DELETE FROM `contact` WHERE `id` = %d LIMIT 1", intval($id) ); From 249a6814cd777e8eb9d4feb788058ec4683e9522 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 01:08:28 -0700 Subject: [PATCH 17/41] add db field for removed account, which will also be the first test of update error checking --- boot.php | 2 +- database.sql | 4 +++- update.php | 11 +++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 616e152f9b..100662a8f8 100644 --- a/boot.php +++ b/boot.php @@ -11,7 +11,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1326' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1139 ); +define ( 'DB_UPDATE_VERSION', 1140 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 78b26922bd..80a9197fa5 100644 --- a/database.sql +++ b/database.sql @@ -1019,6 +1019,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `pwdreset` char(255) NOT NULL, `maxreq` int(11) NOT NULL DEFAULT '10', `expire` int(10) unsigned NOT NULL DEFAULT '0', + `account_removed` tinyint(1) NOT NULL DEFAULT '0', `account_expired` tinyint(1) NOT NULL DEFAULT '0', `account_expires_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `expire_notification_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -1036,7 +1037,8 @@ CREATE TABLE IF NOT EXISTS `user` ( KEY `blocked` (`blocked`), KEY `verified` (`verified`), KEY `unkmail` (`unkmail`), - KEY `cntunkmail` (`cntunkmail`) + KEY `cntunkmail` (`cntunkmail`), + KEY `account_removed` (`account_removed`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- diff --git a/update.php b/update.php index 2758f59066..3c2ecebb6b 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Sun, 29 Apr 2012 01:42:48 -0700 Subject: [PATCH 18/41] enhanced profile reporting for single values --- mod/profiles.php | 66 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index 7a33a03e44..478aab8a5d 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -139,21 +139,49 @@ function profiles_post(&$a) { $changes = array(); + $value = ''; if($is_default) { - if($marital != $orig[0]['marital']) $changes[] = '♥ ' . t('Marital Status'); - if($withchanged) $changes[] = '♥ ' . t('Romantic Partner'); - if($work != $orig[0]['work']) $changes[] = t('Work/Employment'); - if($religion != $orig[0]['religion']) $changes[] = t('Religion'); - if($politic != $orig[0]['politic']) $changes[] = t('Political Views'); - if($gender != $orig[0]['gender']) $changes[] = t('Gender'); - if($sexual != $orig[0]['sexual']) $changes[] = t('Sexual Preference'); - if($homepage != $orig[0]['homepage']) $changes[] = t('Homepage'); - if($interest != $orig[0]['interest']) $changes[] = t('Interests'); + if($marital != $orig[0]['marital']) { + $changes[] = '♥ ' . t('Marital Status'); + $value = $marital; + } + if($withchanged) { + $changes[] = '♥ ' . t('Romantic Partner'); + $value = strip_tags($with); + } + if($work != $orig[0]['work']) { + $changes[] = t('Work/Employment'); + } + if($religion != $orig[0]['religion']) { + $changes[] = t('Religion'); + $value = $religion; + } + if($politic != $orig[0]['politic']) { + $changes[] = t('Political Views'); + $value = $politic; + } + if($gender != $orig[0]['gender']) { + $changes[] = t('Gender'); + $value = $gender; + } + if($sexual != $orig[0]['sexual']) { + $changes[] = t('Sexual Preference'); + $value = $sexual; + } + if($homepage != $orig[0]['homepage']) { + $changes[] = t('Homepage'); + $value = $homepage; + } + if($interest != $orig[0]['interest']) { + $changes[] = t('Interests'); + $value = $interest; + } if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region'] - || $country_name != $orig[0]['country_name']) - $changes[] = t('Location'); + || $country_name != $orig[0]['country_name']) { + $changes[] = t('Location'); + } - profile_activity($changes); + profile_activity($changes,$value); } @@ -245,7 +273,7 @@ function profiles_post(&$a) { } -function profile_activity($changed) { +function profile_activity($changed, $value) { $a = get_app(); if(! local_user() || ! is_array($changed) || ! count($changed)) @@ -289,7 +317,7 @@ function profile_activity($changed) { foreach($changed as $ch) { if(strlen($changes)) { if ($z == ($t - 1)) - $changes .= ' and '; + $changes .= t(' and '); else $changes .= ', '; } @@ -299,7 +327,15 @@ function profile_activity($changed) { $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; - $arr['body'] = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); + if($t == 1 && strlen($value)) { + $message = sprintf( t('%1$s changed %2$s to %3$s'), $A, $changes, $value); + $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof); + } + else + $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); + + + $arr['body'] = $message; $arr['object'] = '' . ACTIVITY_OBJ_PROFILE . '' . $self[0]['name'] . '' . '' . $self[0]['url'] . '/' . $self[0]['name'] . ''; From 735f518fd8547fab37ca39c7717e8d89e07e3337 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 01:49:54 -0700 Subject: [PATCH 19/41] fix location change notification --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/profiles.php b/mod/profiles.php index 478aab8a5d..d640ba1ba5 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -177,7 +177,7 @@ function profiles_post(&$a) { $value = $interest; } if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region'] - || $country_name != $orig[0]['country_name']) { + || $country_name != $orig[0]['country-name']) { $changes[] = t('Location'); } From def6f0b408680c4e5f209890bbf1ad6bf40b5add Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 02:11:33 -0700 Subject: [PATCH 20/41] the heart should really be red. --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/profiles.php b/mod/profiles.php index d640ba1ba5..3a52c8fa5e 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -142,7 +142,7 @@ function profiles_post(&$a) { $value = ''; if($is_default) { if($marital != $orig[0]['marital']) { - $changes[] = '♥ ' . t('Marital Status'); + $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status'); $value = $marital; } if($withchanged) { From ab908469ae89cbc7ba3b45b25fd85668e51abaea Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Mon, 30 Apr 2012 02:00:41 +0200 Subject: [PATCH 21/41] close one menu (like the notifications menu) when another one is opened (like it is done when clicking somewhere else) (thx to ^mw) --- js/main.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/main.js b/js/main.js index ac238bf6aa..6a26324419 100644 --- a/js/main.js +++ b/js/main.js @@ -73,7 +73,16 @@ setupFieldRichtext(); /* popup menus */ + function close_last_popup_menu() { + if(last_popup_menu) { + last_popup_menu.hide(); + last_popup_button.removeClass("selected"); + last_popup_menu = null; + last_popup_button = null; + } + } $('a[rel^=#]').click(function(e){ + close_last_popup_menu(); menu = $( $(this).attr('rel') ); e.preventDefault(); e.stopPropagation(); @@ -90,12 +99,7 @@ return false; }); $('html').click(function() { - if(last_popup_menu) { - last_popup_menu.hide(); - last_popup_button.removeClass("selected"); - last_popup_menu = null; - last_popup_button = null; - } + close_last_popup_menu(); }); // fancyboxes From e3fecb2557ad0ac2f156f9583683f7c9d998e212 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 17:34:54 -0700 Subject: [PATCH 22/41] improved db error logging --- boot.php | 2 +- include/dba.php | 26 +++-- util/messages.po | 253 ++++++++++++++++++++++++++--------------------- 3 files changed, 157 insertions(+), 124 deletions(-) diff --git a/boot.php b/boot.php index 100662a8f8..aefc694e64 100644 --- a/boot.php +++ b/boot.php @@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1326' ); +define ( 'FRIENDICA_VERSION', '2.3.1327' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1140 ); diff --git a/include/dba.php b/include/dba.php index 44a663eac4..414f4ae7a7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -74,23 +74,29 @@ class dba { if((! $this->db) || (! $this->connected)) return false; + + $this->error = ''; if($this->mysqli) $result = @$this->db->query($sql); else $result = @mysql_query($sql,$this->db); + if($this->mysqli) { + if($this->db->errno) + $this->error = $this->db->error; + } + elseif(mysql_errno($this->db)) + $this->error = mysql_error($this->db); + + if(strlen($this->error)) { + logger('dba: ' . $this->error); + } + if($this->debug) { $mesg = ''; - if($this->mysqli) { - if($this->db->errno) - logger('dba: ' . $this->db->error); - } - elseif(mysql_errno($this->db)) - logger('dba: ' . mysql_error($this->db)); - if($result === false) $mesg = 'false'; elseif($result === true) @@ -102,7 +108,9 @@ class dba { $mesg = mysql_num_rows($result) . ' results' . EOL; } - $str = 'SQL = ' . printable($sql) . EOL . 'SQL returned ' . $mesg . EOL; + $str = 'SQL = ' . printable($sql) . EOL . 'SQL returned ' . $mesg + . (($this->error) ? ' error: ' . $this->error : '') + . EOL; logger('dba: ' . $str ); } @@ -116,7 +124,7 @@ class dba { if($result === false) { logger('dba: ' . printable($sql) . ' returned false.'); if(file_exists('dbfail.out')) - file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n", FILE_APPEND); + file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND); } if(($result === true) || ($result === false)) diff --git a/util/messages.po b/util/messages.po index f6e149620b..535283b0b5 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2.3.1326\n" +"Project-Id-Version: 2.3.1327\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-04-28 10:00-0700\n" +"POT-Creation-Date: 2012-04-29 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,7 +52,7 @@ msgstr "" #: ../../mod/message.php:90 ../../mod/allfriends.php:9 #: ../../mod/nogroup.php:25 ../../mod/wall_upload.php:53 #: ../../mod/follow.php:8 ../../mod/common.php:9 ../../mod/display.php:138 -#: ../../mod/profiles.php:7 ../../mod/profiles.php:329 +#: ../../mod/profiles.php:7 ../../mod/profiles.php:365 #: ../../mod/delegate.php:6 ../../mod/suggest.php:28 ../../mod/invite.php:13 #: ../../mod/invite.php:81 ../../mod/dfrn_confirm.php:53 #: ../../addon/facebook/facebook.php:484 ../../include/items.php:3171 @@ -132,7 +132,7 @@ msgstr "" #: ../../mod/settings.php:744 ../../mod/settings.php:935 #: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/admin.php:393 #: ../../mod/admin.php:572 ../../mod/admin.php:708 ../../mod/admin.php:907 -#: ../../mod/admin.php:995 ../../mod/profiles.php:498 ../../mod/invite.php:119 +#: ../../mod/admin.php:995 ../../mod/profiles.php:534 ../../mod/invite.php:119 #: ../../addon/facebook/facebook.php:574 ../../addon/yourls/yourls.php:76 #: ../../addon/ljpost/ljpost.php:93 ../../addon/nsfw/nsfw.php:57 #: ../../addon/planets/planets.php:158 @@ -220,7 +220,7 @@ msgid "link to source" msgstr "" #: ../../mod/events.php:296 ../../view/theme/diabook/theme.php:255 -#: ../../include/nav.php:52 ../../boot.php:1481 +#: ../../include/nav.php:52 ../../boot.php:1487 msgid "Events" msgstr "" @@ -270,7 +270,7 @@ msgid "Description:" msgstr "" #: ../../mod/events.php:395 ../../include/event.php:37 -#: ../../include/bb2diaspora.php:260 ../../boot.php:1083 +#: ../../include/bb2diaspora.php:260 ../../boot.php:1089 msgid "Location:" msgstr "" @@ -330,7 +330,7 @@ msgstr "" #: ../../mod/settings.php:884 ../../mod/settings.php:890 #: ../../mod/settings.php:926 ../../mod/settings.php:927 #: ../../mod/settings.php:928 ../../mod/settings.php:929 -#: ../../mod/register.php:532 ../../mod/profiles.php:475 +#: ../../mod/register.php:532 ../../mod/profiles.php:511 msgid "Yes" msgstr "" @@ -341,7 +341,7 @@ msgstr "" #: ../../mod/settings.php:884 ../../mod/settings.php:890 #: ../../mod/settings.php:926 ../../mod/settings.php:927 #: ../../mod/settings.php:928 ../../mod/settings.php:929 -#: ../../mod/register.php:533 ../../mod/profiles.php:476 +#: ../../mod/register.php:533 ../../mod/profiles.php:512 msgid "No" msgstr "" @@ -545,7 +545,7 @@ msgstr "" #: ../../mod/photos.php:1232 ../../mod/photos.php:1272 #: ../../mod/photos.php:1303 ../../include/conversation.php:554 -#: ../../boot.php:495 +#: ../../boot.php:503 msgid "Comment" msgstr "" @@ -1166,7 +1166,7 @@ msgid "is interested in:" msgstr "" #: ../../mod/match.php:58 ../../mod/suggest.php:59 -#: ../../include/contact_widgets.php:9 ../../boot.php:1027 +#: ../../include/contact_widgets.php:9 ../../boot.php:1033 msgid "Connect" msgstr "" @@ -1648,6 +1648,7 @@ msgstr "" #: ../../addon/facebook/facebook.php:650 #: ../../addon/facebook/facebook.php:1139 #: ../../addon/testdrive/testdrive.php:58 ../../include/items.php:2700 +#: ../../boot.php:683 msgid "Administrator" msgstr "" @@ -1657,7 +1658,7 @@ msgid "" "Password reset failed." msgstr "" -#: ../../mod/lostpass.php:83 ../../boot.php:809 +#: ../../mod/lostpass.php:83 ../../boot.php:815 msgid "Password Reset" msgstr "" @@ -2279,7 +2280,7 @@ msgstr "" msgid "Invalid contact." msgstr "" -#: ../../mod/notes.php:44 ../../boot.php:1486 +#: ../../mod/notes.php:44 ../../boot.php:1492 msgid "Personal Notes" msgstr "" @@ -2530,7 +2531,7 @@ msgstr "" #: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:252 #: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:74 -#: ../../include/nav.php:50 ../../boot.php:1468 +#: ../../include/nav.php:50 ../../boot.php:1474 msgid "Profile" msgstr "" @@ -2702,7 +2703,7 @@ msgstr "" msgid "Choose a nickname: " msgstr "" -#: ../../mod/register.php:567 ../../include/nav.php:81 ../../boot.php:775 +#: ../../mod/register.php:567 ../../include/nav.php:81 ../../boot.php:781 msgid "Register" msgstr "" @@ -2745,7 +2746,7 @@ msgid "Access denied." msgstr "" #: ../../mod/fbrowser.php:23 ../../view/theme/diabook/theme.php:254 -#: ../../include/nav.php:51 ../../boot.php:1473 +#: ../../include/nav.php:51 ../../boot.php:1479 msgid "Photos" msgstr "" @@ -3451,7 +3452,7 @@ msgstr "" msgid "FTP Password" msgstr "" -#: ../../mod/profile.php:21 ../../boot.php:940 +#: ../../mod/profile.php:21 ../../boot.php:946 msgid "Requested profile is not available." msgstr "" @@ -3595,8 +3596,8 @@ msgstr "" msgid "Search This Site" msgstr "" -#: ../../mod/profiles.php:21 ../../mod/profiles.php:339 -#: ../../mod/profiles.php:453 ../../mod/dfrn_confirm.php:62 +#: ../../mod/profiles.php:21 ../../mod/profiles.php:375 +#: ../../mod/profiles.php:489 ../../mod/dfrn_confirm.php:62 msgid "Profile not found." msgstr "" @@ -3604,259 +3605,273 @@ msgstr "" msgid "Profile Name is required." msgstr "" -#: ../../mod/profiles.php:143 +#: ../../mod/profiles.php:145 msgid "Marital Status" msgstr "" -#: ../../mod/profiles.php:144 +#: ../../mod/profiles.php:149 msgid "Romantic Partner" msgstr "" -#: ../../mod/profiles.php:145 +#: ../../mod/profiles.php:153 msgid "Work/Employment" msgstr "" -#: ../../mod/profiles.php:146 +#: ../../mod/profiles.php:156 msgid "Religion" msgstr "" -#: ../../mod/profiles.php:147 +#: ../../mod/profiles.php:160 msgid "Political Views" msgstr "" -#: ../../mod/profiles.php:148 +#: ../../mod/profiles.php:164 msgid "Gender" msgstr "" -#: ../../mod/profiles.php:149 +#: ../../mod/profiles.php:168 msgid "Sexual Preference" msgstr "" -#: ../../mod/profiles.php:150 +#: ../../mod/profiles.php:172 msgid "Homepage" msgstr "" -#: ../../mod/profiles.php:151 +#: ../../mod/profiles.php:176 msgid "Interests" msgstr "" -#: ../../mod/profiles.php:154 +#: ../../mod/profiles.php:181 msgid "Location" msgstr "" -#: ../../mod/profiles.php:225 +#: ../../mod/profiles.php:253 msgid "Profile updated." msgstr "" -#: ../../mod/profiles.php:300 +#: ../../mod/profiles.php:320 +msgid " and " +msgstr "" + +#: ../../mod/profiles.php:328 msgid "public profile" msgstr "" -#: ../../mod/profiles.php:302 +#: ../../mod/profiles.php:331 +#, php-format +msgid "%1$s changed %2$s to %3$s" +msgstr "" + +#: ../../mod/profiles.php:332 +#, php-format +msgid " - Visit %1$s's %2$s" +msgstr "" + +#: ../../mod/profiles.php:335 #, php-format msgid "%1$s has an updated %2$s, changing %3$s." msgstr "" -#: ../../mod/profiles.php:358 +#: ../../mod/profiles.php:394 msgid "Profile deleted." msgstr "" -#: ../../mod/profiles.php:376 ../../mod/profiles.php:410 +#: ../../mod/profiles.php:412 ../../mod/profiles.php:446 msgid "Profile-" msgstr "" -#: ../../mod/profiles.php:395 ../../mod/profiles.php:437 +#: ../../mod/profiles.php:431 ../../mod/profiles.php:473 msgid "New profile created." msgstr "" -#: ../../mod/profiles.php:416 +#: ../../mod/profiles.php:452 msgid "Profile unavailable to clone." msgstr "" -#: ../../mod/profiles.php:474 +#: ../../mod/profiles.php:510 msgid "Hide your contact/friend list from viewers of this profile?" msgstr "" -#: ../../mod/profiles.php:497 +#: ../../mod/profiles.php:533 msgid "Edit Profile Details" msgstr "" -#: ../../mod/profiles.php:499 +#: ../../mod/profiles.php:535 msgid "View this profile" msgstr "" -#: ../../mod/profiles.php:500 +#: ../../mod/profiles.php:536 msgid "Create a new profile using these settings" msgstr "" -#: ../../mod/profiles.php:501 +#: ../../mod/profiles.php:537 msgid "Clone this profile" msgstr "" -#: ../../mod/profiles.php:502 +#: ../../mod/profiles.php:538 msgid "Delete this profile" msgstr "" -#: ../../mod/profiles.php:503 +#: ../../mod/profiles.php:539 msgid "Profile Name:" msgstr "" -#: ../../mod/profiles.php:504 +#: ../../mod/profiles.php:540 msgid "Your Full Name:" msgstr "" -#: ../../mod/profiles.php:505 +#: ../../mod/profiles.php:541 msgid "Title/Description:" msgstr "" -#: ../../mod/profiles.php:506 +#: ../../mod/profiles.php:542 msgid "Your Gender:" msgstr "" -#: ../../mod/profiles.php:507 +#: ../../mod/profiles.php:543 #, php-format msgid "Birthday (%s):" msgstr "" -#: ../../mod/profiles.php:508 +#: ../../mod/profiles.php:544 msgid "Street Address:" msgstr "" -#: ../../mod/profiles.php:509 +#: ../../mod/profiles.php:545 msgid "Locality/City:" msgstr "" -#: ../../mod/profiles.php:510 +#: ../../mod/profiles.php:546 msgid "Postal/Zip Code:" msgstr "" -#: ../../mod/profiles.php:511 +#: ../../mod/profiles.php:547 msgid "Country:" msgstr "" -#: ../../mod/profiles.php:512 +#: ../../mod/profiles.php:548 msgid "Region/State:" msgstr "" -#: ../../mod/profiles.php:513 +#: ../../mod/profiles.php:549 msgid " Marital Status:" msgstr "" -#: ../../mod/profiles.php:514 +#: ../../mod/profiles.php:550 msgid "Who: (if applicable)" msgstr "" -#: ../../mod/profiles.php:515 +#: ../../mod/profiles.php:551 msgid "Examples: cathy123, Cathy Williams, cathy@example.com" msgstr "" -#: ../../mod/profiles.php:516 ../../include/profile_advanced.php:43 +#: ../../mod/profiles.php:552 ../../include/profile_advanced.php:43 msgid "Sexual Preference:" msgstr "" -#: ../../mod/profiles.php:517 +#: ../../mod/profiles.php:553 msgid "Homepage URL:" msgstr "" -#: ../../mod/profiles.php:518 ../../include/profile_advanced.php:49 +#: ../../mod/profiles.php:554 ../../include/profile_advanced.php:49 msgid "Political Views:" msgstr "" -#: ../../mod/profiles.php:519 +#: ../../mod/profiles.php:555 msgid "Religious Views:" msgstr "" -#: ../../mod/profiles.php:520 +#: ../../mod/profiles.php:556 msgid "Public Keywords:" msgstr "" -#: ../../mod/profiles.php:521 +#: ../../mod/profiles.php:557 msgid "Private Keywords:" msgstr "" -#: ../../mod/profiles.php:522 +#: ../../mod/profiles.php:558 msgid "Example: fishing photography software" msgstr "" -#: ../../mod/profiles.php:523 +#: ../../mod/profiles.php:559 msgid "(Used for suggesting potential friends, can be seen by others)" msgstr "" -#: ../../mod/profiles.php:524 +#: ../../mod/profiles.php:560 msgid "(Used for searching profiles, never shown to others)" msgstr "" -#: ../../mod/profiles.php:525 +#: ../../mod/profiles.php:561 msgid "Tell us about yourself..." msgstr "" -#: ../../mod/profiles.php:526 +#: ../../mod/profiles.php:562 msgid "Hobbies/Interests" msgstr "" -#: ../../mod/profiles.php:527 +#: ../../mod/profiles.php:563 msgid "Contact information and Social Networks" msgstr "" -#: ../../mod/profiles.php:528 +#: ../../mod/profiles.php:564 msgid "Musical interests" msgstr "" -#: ../../mod/profiles.php:529 +#: ../../mod/profiles.php:565 msgid "Books, literature" msgstr "" -#: ../../mod/profiles.php:530 +#: ../../mod/profiles.php:566 msgid "Television" msgstr "" -#: ../../mod/profiles.php:531 +#: ../../mod/profiles.php:567 msgid "Film/dance/culture/entertainment" msgstr "" -#: ../../mod/profiles.php:532 +#: ../../mod/profiles.php:568 msgid "Love/romance" msgstr "" -#: ../../mod/profiles.php:533 +#: ../../mod/profiles.php:569 msgid "Work/employment" msgstr "" -#: ../../mod/profiles.php:534 +#: ../../mod/profiles.php:570 msgid "School/education" msgstr "" -#: ../../mod/profiles.php:539 +#: ../../mod/profiles.php:575 msgid "" "This is your public profile.
It may " "be visible to anybody using the internet." msgstr "" -#: ../../mod/profiles.php:549 ../../mod/directory.php:111 +#: ../../mod/profiles.php:585 ../../mod/directory.php:111 msgid "Age: " msgstr "" -#: ../../mod/profiles.php:584 +#: ../../mod/profiles.php:620 msgid "Edit/Manage Profiles" msgstr "" -#: ../../mod/profiles.php:585 ../../boot.php:1049 +#: ../../mod/profiles.php:621 ../../boot.php:1055 msgid "Change profile photo" msgstr "" -#: ../../mod/profiles.php:586 ../../boot.php:1050 +#: ../../mod/profiles.php:622 ../../boot.php:1056 msgid "Create New Profile" msgstr "" -#: ../../mod/profiles.php:597 ../../boot.php:1060 +#: ../../mod/profiles.php:633 ../../boot.php:1066 msgid "Profile Image" msgstr "" -#: ../../mod/profiles.php:599 ../../boot.php:1063 +#: ../../mod/profiles.php:635 ../../boot.php:1069 msgid "visible to everybody" msgstr "" -#: ../../mod/profiles.php:600 ../../boot.php:1064 +#: ../../mod/profiles.php:636 ../../boot.php:1070 msgid "Edit visibility" msgstr "" @@ -4457,7 +4472,7 @@ msgstr "" #: ../../addon/communityhome/communityhome.php:34 #: ../../addon/communityhome/twillingham/communityhome.php:28 #: ../../addon/communityhome/twillingham/communityhome.php:34 -#: ../../include/nav.php:64 ../../boot.php:796 +#: ../../include/nav.php:64 ../../boot.php:802 msgid "Login" msgstr "" @@ -5199,7 +5214,7 @@ msgid "Show More Settings saved." msgstr "" #: ../../addon/showmore/showmore.php:87 ../../include/conversation.php:466 -#: ../../boot.php:496 +#: ../../boot.php:504 msgid "show more" msgstr "" @@ -5503,7 +5518,7 @@ msgstr "" msgid "Set colour scheme" msgstr "" -#: ../../include/profile_advanced.php:17 ../../boot.php:1085 +#: ../../include/profile_advanced.php:17 ../../boot.php:1091 msgid "Gender:" msgstr "" @@ -5524,11 +5539,11 @@ msgstr "" msgid "Age:" msgstr "" -#: ../../include/profile_advanced.php:37 ../../boot.php:1088 +#: ../../include/profile_advanced.php:37 ../../boot.php:1094 msgid "Status:" msgstr "" -#: ../../include/profile_advanced.php:45 ../../boot.php:1090 +#: ../../include/profile_advanced.php:45 ../../boot.php:1096 msgid "Homepage:" msgstr "" @@ -6112,7 +6127,7 @@ msgstr "" msgid "Contacts not in any group" msgstr "" -#: ../../include/nav.php:46 ../../boot.php:795 +#: ../../include/nav.php:46 ../../boot.php:801 msgid "Logout" msgstr "" @@ -6120,7 +6135,7 @@ msgstr "" msgid "End this session" msgstr "" -#: ../../include/nav.php:49 ../../boot.php:1463 +#: ../../include/nav.php:49 ../../boot.php:1469 msgid "Status" msgstr "" @@ -6200,11 +6215,11 @@ msgstr "" msgid "Manage other pages" msgstr "" -#: ../../include/nav.php:138 ../../boot.php:1043 +#: ../../include/nav.php:138 ../../boot.php:1049 msgid "Profiles" msgstr "" -#: ../../include/nav.php:138 ../../boot.php:1043 +#: ../../include/nav.php:138 ../../boot.php:1049 msgid "Manage/edit profiles" msgstr "" @@ -6626,33 +6641,33 @@ msgid "" "form has been opened for too long (>3 hours) before submitting it." msgstr "" -#: ../../include/Contact.php:96 +#: ../../include/Contact.php:111 msgid "stopped following" msgstr "" -#: ../../include/Contact.php:188 ../../include/conversation.php:817 +#: ../../include/Contact.php:203 ../../include/conversation.php:817 msgid "View Status" msgstr "" -#: ../../include/Contact.php:189 ../../include/conversation.php:818 +#: ../../include/Contact.php:204 ../../include/conversation.php:818 msgid "View Profile" msgstr "" -#: ../../include/Contact.php:190 ../../include/conversation.php:819 +#: ../../include/Contact.php:205 ../../include/conversation.php:819 msgid "View Photos" msgstr "" -#: ../../include/Contact.php:191 ../../include/Contact.php:204 +#: ../../include/Contact.php:206 ../../include/Contact.php:219 #: ../../include/conversation.php:820 msgid "Network Posts" msgstr "" -#: ../../include/Contact.php:192 ../../include/Contact.php:204 +#: ../../include/Contact.php:207 ../../include/Contact.php:219 #: ../../include/conversation.php:821 msgid "Edit Contact" msgstr "" -#: ../../include/Contact.php:193 ../../include/Contact.php:204 +#: ../../include/Contact.php:208 ../../include/Contact.php:219 #: ../../include/conversation.php:822 msgid "Send PM" msgstr "" @@ -6879,70 +6894,80 @@ msgstr "" msgid "permissions" msgstr "" -#: ../../boot.php:494 +#: ../../boot.php:502 msgid "Delete this item?" msgstr "" -#: ../../boot.php:497 +#: ../../boot.php:505 msgid "show fewer" msgstr "" -#: ../../boot.php:774 +#: ../../boot.php:678 +#, php-format +msgid "Update %s failed. See error logs." +msgstr "" + +#: ../../boot.php:680 +#, php-format +msgid "Update Error at %s" +msgstr "" + +#: ../../boot.php:780 msgid "Create a New Account" msgstr "" -#: ../../boot.php:798 +#: ../../boot.php:804 msgid "Nickname or Email address: " msgstr "" -#: ../../boot.php:799 +#: ../../boot.php:805 msgid "Password: " msgstr "" -#: ../../boot.php:802 +#: ../../boot.php:808 msgid "Or login using OpenID: " msgstr "" -#: ../../boot.php:808 +#: ../../boot.php:814 msgid "Forgot your password?" msgstr "" -#: ../../boot.php:975 +#: ../../boot.php:981 msgid "Edit profile" msgstr "" -#: ../../boot.php:1035 +#: ../../boot.php:1041 msgid "Message" msgstr "" -#: ../../boot.php:1151 ../../boot.php:1227 +#: ../../boot.php:1157 ../../boot.php:1233 msgid "g A l F d" msgstr "" -#: ../../boot.php:1152 ../../boot.php:1228 +#: ../../boot.php:1158 ../../boot.php:1234 msgid "F d" msgstr "" -#: ../../boot.php:1197 ../../boot.php:1268 +#: ../../boot.php:1203 ../../boot.php:1274 msgid "[today]" msgstr "" -#: ../../boot.php:1209 +#: ../../boot.php:1215 msgid "Birthday Reminders" msgstr "" -#: ../../boot.php:1210 +#: ../../boot.php:1216 msgid "Birthdays this week:" msgstr "" -#: ../../boot.php:1261 +#: ../../boot.php:1267 msgid "[No description]" msgstr "" -#: ../../boot.php:1279 +#: ../../boot.php:1285 msgid "Event Reminders" msgstr "" -#: ../../boot.php:1280 +#: ../../boot.php:1286 msgid "Events this week:" msgstr "" From 0153d86b7f4e2913b1eb985a905f7eb94822b589 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 19:10:07 -0700 Subject: [PATCH 23/41] admin page to manage failed updates --- boot.php | 2 +- mod/admin.php | 66 +++++++++++++++++++++++++++++++++++++++-- view/admin_aside.tpl | 1 + view/failed_updates.tpl | 17 +++++++++++ 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 view/failed_updates.tpl diff --git a/boot.php b/boot.php index aefc694e64..733d94b1e1 100644 --- a/boot.php +++ b/boot.php @@ -667,7 +667,7 @@ if(! function_exists('check_config')) { // call the specific update $func = 'update_' . $x; - $retval = $func($a); + $retval = $func(); if($retval) { //send the administrator an e-mail $email_tpl = get_intltext_template("update_fail_eml.tpl"); diff --git a/mod/admin.php b/mod/admin.php index 3b6d186d55..b07ef851a1 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -61,6 +61,9 @@ function admin_post(&$a){ case 'logs': admin_page_logs_post($a); break; + case 'dbsync': + admin_page_dbsync_post($a); + break; case 'update': admin_page_remoteupdate_post($a); break; @@ -94,7 +97,8 @@ function admin_content(&$a) { 'users' => Array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"), 'plugins'=> Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"), 'themes' => Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"), - 'update' => Array($a->get_baseurl(true)."/admin/update/", t("Update") , "update") + 'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"), + 'update' => Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update") ); /* get plugins admin page */ @@ -142,6 +146,9 @@ function admin_content(&$a) { case 'logs': $o = admin_page_logs($a); break; + case 'dbsync': + $o = admin_page_dbsync($a); + break; case 'update': $o = admin_page_remoteupdate($a); break; @@ -435,6 +442,62 @@ function admin_page_site(&$a) { } +function admin_page_dbsync(&$a) { + + $o = ''; + + if($a->argc > 3 && intval($a->argv[3]) && $a->argv[2] === 'mark') { + set_config('database', 'update_' . intval($a->argv[3]), 'success'); + info( t('Update has been marked successful') . EOL); + goaway($a->get_baseurl(true) . '/admin/dbsync'); + } + + if($a->argc > 2 && intval($a->argv[2])) { + require_once('update.php'); + $func = 'update_' . intval($a->argv[2]); + if(function_exists($func)) { + $retval = $func(); + if($retval === UPDATE_FAILED) { + $o .= sprintf( t('Executing %s failed. Check system logs.'), $func); + } + elseif($retval === UPDATE_SUCCESS) { + $o .= sprintf( t('Update %s was successfully applied.', $func)); + set_config('database',$func, 'success'); + } + else + $o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $func); + } + else + $o .= sprintf( t('Update function %s could not be found.'), $func); + return $o; + } + + $failed = array(); + $r = q("select * from config where `cat` = 'database' "); + if(count($r)) { + foreach($r as $rr) { + $upd = intval(substr($rr['k'],7)); + if($upd < 1139 || $rr['v'] === 'success') + continue; + $failed[] = $upd; + } + } + if(! count($failed)) + return '

' . t('No failed updates.') . '

'; + + $o = replace_macros(get_markup_template('failed_updates.tpl'),array( + '$base' => $a->get_baseurl(true), + '$banner' => t('Failed Updates'), + '$desc' => t('This does not include updates prior to 1139, which did not return a status.'), + '$mark' => t('Mark success (if update was manually applied)'), + '$apply' => t('Attempt to execute this update step automatically'), + '$failed' => $failed + )); + + return $o; + +} + /** * Users admin page * @@ -979,7 +1042,6 @@ readable."); $size = 5000000; $seek = fseek($fp,0-$size,SEEK_END); if($seek === 0) { - fgets($fp); // throw away the first partial line $data = escape_tags(fread($fp,$size)); while(! feof($fp)) $data .= escape_tags(fread($fp,4096)); diff --git a/view/admin_aside.tpl b/view/admin_aside.tpl index a3c98e2ce4..f25a1eb4ba 100644 --- a/view/admin_aside.tpl +++ b/view/admin_aside.tpl @@ -16,6 +16,7 @@ +