aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-05-20 18:30:02 -0700
committerfriendica <info@friendica.com>2012-05-20 18:30:02 -0700
commitafaf9ec74fe0662de76deabd11d630f871802579 (patch)
tree58e41106d72d5b76e00de9cf82a00ef82b6edd77
parentf16a1199408d167bbc7c52dc408ef02b36808317 (diff)
downloadvolse-hubzilla-afaf9ec74fe0662de76deabd11d630f871802579.tar.gz
volse-hubzilla-afaf9ec74fe0662de76deabd11d630f871802579.tar.bz2
volse-hubzilla-afaf9ec74fe0662de76deabd11d630f871802579.zip
rev update
-rw-r--r--boot.php21
-rw-r--r--include/crypto.php36
-rw-r--r--include/delivery.php2
-rw-r--r--include/notifier.php32
-rw-r--r--mod/dfrn_confirm.php15
-rw-r--r--mod/hostxrd.php22
-rw-r--r--mod/register.php37
-rw-r--r--util/messages.po128
8 files changed, 158 insertions, 135 deletions
diff --git a/boot.php b/boot.php
index f56a70319..4b4788dbd 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', '3.0.1347' );
+define ( 'FRIENDICA_VERSION', '3.0.1348' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1144 );
@@ -1323,6 +1323,25 @@ if(! function_exists('proc_run')) {
$a = get_app();
$args = func_get_args();
+
+ $newargs = array();
+ if(! count($args))
+ return;
+
+ // expand any arrays
+
+ foreach($args as $arg) {
+ if(is_array($arg)) {
+ foreach($arg as $n) {
+ $newargs[] = $n;
+ }
+ }
+ else
+ $newargs[] = $arg;
+ }
+
+ $args = $newargs;
+
$arr = array('args' => $args, 'run_cmd' => true);
call_hooks("proc_run", $arr);
diff --git a/include/crypto.php b/include/crypto.php
index 0feb45c24..6fc9a287e 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -292,4 +292,38 @@ function zot_unencapsulate($data,$prvkey) {
$ret['sender'] = $s;
$ret['data'] = aes_unencapsulate($x,$prvkey);
return $ret;
-} \ No newline at end of file
+}
+
+function new_keypair($bits) {
+
+ $openssl_options = array(
+ 'digest_alg' => 'sha1',
+ 'private_key_bits' => $bits,
+ 'encrypt_key' => false
+ );
+
+ $conf = get_config('system','openssl_conf_file');
+ if($conf)
+ $openssl_options['config'] = $conf;
+
+ $result = openssl_pkey_new($openssl_options);
+
+ if(empty($result)) {
+ logger('new_keypair: failed');
+ return false;
+ }
+
+ // Get private key
+
+ $response = array('prvkey' => '', 'pubkey' => '');
+
+ openssl_pkey_export($result, $response['prvkey']);
+
+ // Get public key
+ $pkey = openssl_pkey_get_details($result);
+ $response['pubkey'] = $pkey["key"];
+
+ return $response;
+
+}
+
diff --git a/include/delivery.php b/include/delivery.php
index 1cee2d697..61b0bd33a 100644
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -41,7 +41,7 @@ function delivery_run($argv, $argc){
for($x = 3; $x < $argc; $x ++) {
- $contact_id = intval($argv[x]);
+ $contact_id = intval($argv[$x]);
// Some other process may have delivered this item already.
diff --git a/include/notifier.php b/include/notifier.php
index 8b904dbcd..cb4fb2a31 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -478,24 +478,42 @@ function notifier_run($argv, $argc){
}
}
+
+ // This controls the number of deliveries to execute with each separate delivery process.
+ // By default we'll perform one delivery per process. Assuming a hostile shared hosting
+ // provider, this provides the greatest chance of deliveries if processes start getting
+ // killed. We can also space them out with the delivery_interval to also help avoid them
+ // getting whacked.
+
+ // If $deliveries_per_process > 1, we will chain this number of multiple deliveries
+ // together into a single process. This will reduce the overall number of processes
+ // spawned for each delivery, but they will run longer.
+
$deliveries_per_process = intval(get_config('system','delivery_batch_count'));
if($deliveries_per_process <= 0)
$deliveries_per_process = 1;
$this_batch = array();
- foreach($r as $contact) {
+ for($x = 0; $x < count($r); $x ++) {
+ $contact = $r[$x];
+
if($contact['self'])
continue;
// potentially more than one recipient. Start a new process and space them out a bit.
- // we will deliver single recipient types of message and email receipients here.
-
+ // we will deliver single recipient types of message and email recipients here.
+
if((! $mail) && (! $fsuggest) && (! $followup)) {
- // deliveries per process not yet implemented, 1 delivery per process.
- proc_run('php','include/delivery.php',$cmd,$item_id,$contact['id']);
- if($interval)
- @time_sleep_until(microtime(true) + (float) $interval);
+
+ $this_batch[] = $contact['id'];
+
+ if(count($this_batch) == $deliveries_per_process) {
+ proc_run('php','include/delivery.php',$cmd,$item_id,$this_batch);
+ $this_batch = array();
+ if($interval)
+ @time_sleep_until(microtime(true) + (float) $interval);
+ }
continue;
}
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 227d72cbf..093993bbc 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -144,19 +144,12 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
* worried about key leakage than anybody cracking it.
*
*/
+ require_once('include/crypto.php');
- $res = openssl_pkey_new(array(
- 'digest_alg' => 'sha1',
- 'private_key_bits' => 4096,
- 'encrypt_key' => false )
- );
-
- $private_key = '';
-
- openssl_pkey_export($res, $private_key);
+ $res = new_keypair(1024);
- $pubkey = openssl_pkey_get_details($res);
- $public_key = $pubkey["key"];
+ $private_key = $res['prvkey'];
+ $public_key = $res['pubkey'];
// Save the private key. Send them the public key.
diff --git a/mod/hostxrd.php b/mod/hostxrd.php
index fe61a874c..9b2411f26 100644
--- a/mod/hostxrd.php
+++ b/mod/hostxrd.php
@@ -8,26 +8,10 @@ function hostxrd_init(&$a) {
$pubkey = get_config('system','site_pubkey');
if(! $pubkey) {
+ $res = new_keypair(1024);
- // should only have to ever do this once.
-
- $res=openssl_pkey_new(array(
- 'digest_alg' => 'sha1',
- 'private_key_bits' => 4096,
- 'encrypt_key' => false ));
-
-
- $prvkey = '';
-
- openssl_pkey_export($res, $prvkey);
-
- // Get public key
-
- $pkey = openssl_pkey_get_details($res);
- $pubkey = $pkey["key"];
-
- set_config('system','site_prvkey', $prvkey);
- set_config('system','site_pubkey', $pubkey);
+ set_config('system','site_prvkey', $res['prvkey']);
+ set_config('system','site_pubkey', $res['pubkey']);
}
$tpl = file_get_contents('view/xrd_host.tpl');
diff --git a/mod/register.php b/mod/register.php
index b60707d45..58bba8533 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -171,26 +171,17 @@ function register_post(&$a) {
$new_password = autoname(6) . mt_rand(100,9999);
$new_password_encoded = hash('whirlpool',$new_password);
- $res=openssl_pkey_new(array(
- 'digest_alg' => 'sha1',
- 'private_key_bits' => 4096,
- 'encrypt_key' => false ));
+ require_once('include/crypto.php');
- // Get private key
+ $result = new_keypair(1024);
- if(empty($res)) {
+ if($result === false) {
notice( t('SERIOUS ERROR: Generation of security keys failed.') . EOL);
return;
}
- $prvkey = '';
-
- openssl_pkey_export($res, $prvkey);
-
- // Get public key
-
- $pkey = openssl_pkey_get_details($res);
- $pubkey = $pkey["key"];
+ $prvkey = $result['prvkey'];
+ $pubkey = $result['pubkey'];
/**
*
@@ -203,21 +194,9 @@ function register_post(&$a) {
*
*/
- $sres=openssl_pkey_new(array(
- 'digest_alg' => 'sha1',
- 'private_key_bits' => 512,
- 'encrypt_key' => false ));
-
- // Get private key
-
- $sprvkey = '';
-
- openssl_pkey_export($sres, $sprvkey);
-
- // Get public key
-
- $spkey = openssl_pkey_get_details($sres);
- $spubkey = $spkey["key"];
+ $sres = new_keypair(512);
+ $sprvkey = $sres['prvkey'];
+ $spubkey = $sres['pubkey'];
$r = q("INSERT INTO `user` ( `guid`, `username`, `password`, `email`, `openid`, `nickname`,
`pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone` )
diff --git a/util/messages.po b/util/messages.po
index 456f50cda..65674774a 100644
--- a/util/messages.po
+++ b/util/messages.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 3.0.1347\n"
+"Project-Id-Version: 3.0.1348\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-19 10:00-0700\n"
+"POT-Creation-Date: 2012-05-20 10:00-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -330,7 +330,7 @@ msgstr ""
#: ../../mod/settings.php:910 ../../mod/settings.php:916
#: ../../mod/settings.php:952 ../../mod/settings.php:953
#: ../../mod/settings.php:954 ../../mod/settings.php:955
-#: ../../mod/register.php:532 ../../mod/profiles.php:511
+#: ../../mod/register.php:511 ../../mod/profiles.php:511
msgid "Yes"
msgstr ""
@@ -341,7 +341,7 @@ msgstr ""
#: ../../mod/settings.php:910 ../../mod/settings.php:916
#: ../../mod/settings.php:952 ../../mod/settings.php:953
#: ../../mod/settings.php:954 ../../mod/settings.php:955
-#: ../../mod/register.php:533 ../../mod/profiles.php:512
+#: ../../mod/register.php:512 ../../mod/profiles.php:512
msgid "No"
msgstr ""
@@ -369,8 +369,8 @@ msgid "Contact information unavailable"
msgstr ""
#: ../../mod/photos.php:151 ../../mod/photos.php:597 ../../mod/photos.php:950
-#: ../../mod/photos.php:965 ../../mod/register.php:335
-#: ../../mod/register.php:342 ../../mod/register.php:349
+#: ../../mod/photos.php:965 ../../mod/register.php:314
+#: ../../mod/register.php:321 ../../mod/register.php:328
#: ../../mod/profile_photo.php:60 ../../mod/profile_photo.php:67
#: ../../mod/profile_photo.php:74 ../../mod/profile_photo.php:174
#: ../../mod/profile_photo.php:252 ../../mod/profile_photo.php:261
@@ -577,7 +577,7 @@ msgstr ""
msgid "Community"
msgstr ""
-#: ../../mod/community.php:61 ../../mod/search.php:134
+#: ../../mod/community.php:61 ../../mod/search.php:138
msgid "No results."
msgstr ""
@@ -1170,7 +1170,7 @@ msgstr ""
msgid "Connect"
msgstr ""
-#: ../../mod/match.php:65 ../../mod/dirfind.php:57
+#: ../../mod/match.php:65 ../../mod/dirfind.php:60
msgid "No matches"
msgstr ""
@@ -1687,8 +1687,8 @@ msgid "Password reset requested at %s"
msgstr ""
#: ../../mod/lostpass.php:45 ../../mod/lostpass.php:107
-#: ../../mod/register.php:388 ../../mod/register.php:442
-#: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:752
+#: ../../mod/register.php:367 ../../mod/register.php:421
+#: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:745
#: ../../addon/facebook/facebook.php:688
#: ../../addon/facebook/facebook.php:1178
#: ../../addon/public_server/public_server.php:62
@@ -2686,7 +2686,7 @@ msgid ""
"must also begin with a letter."
msgstr ""
-#: ../../mod/register.php:153 ../../mod/register.php:264
+#: ../../mod/register.php:153 ../../mod/register.php:243
msgid "Nickname is already registered. Please choose another."
msgstr ""
@@ -2696,107 +2696,107 @@ msgid ""
"another."
msgstr ""
-#: ../../mod/register.php:182
+#: ../../mod/register.php:179
msgid "SERIOUS ERROR: Generation of security keys failed."
msgstr ""
-#: ../../mod/register.php:250
+#: ../../mod/register.php:229
msgid "An error occurred during registration. Please try again."
msgstr ""
-#: ../../mod/register.php:286
+#: ../../mod/register.php:265
msgid "An error occurred creating your default profile. Please try again."
msgstr ""
-#: ../../mod/register.php:386 ../../mod/regmod.php:52
+#: ../../mod/register.php:365 ../../mod/regmod.php:52
#, php-format
msgid "Registration details for %s"
msgstr ""
-#: ../../mod/register.php:394
+#: ../../mod/register.php:373
msgid ""
"Registration successful. Please check your email for further instructions."
msgstr ""
-#: ../../mod/register.php:398
+#: ../../mod/register.php:377
msgid "Failed to send email message. Here is the message that failed."
msgstr ""
-#: ../../mod/register.php:403
+#: ../../mod/register.php:382
msgid "Your registration can not be processed."
msgstr ""
-#: ../../mod/register.php:440
+#: ../../mod/register.php:419
#, php-format
msgid "Registration request at %s"
msgstr ""
-#: ../../mod/register.php:449
+#: ../../mod/register.php:428
msgid "Your registration is pending approval by the site owner."
msgstr ""
-#: ../../mod/register.php:487
+#: ../../mod/register.php:466
msgid ""
"This site has exceeded the number of allowed daily account registrations. "
"Please try again tomorrow."
msgstr ""
-#: ../../mod/register.php:513
+#: ../../mod/register.php:492
msgid ""
"You may (optionally) fill in this form via OpenID by supplying your OpenID "
"and clicking 'Register'."
msgstr ""
-#: ../../mod/register.php:514
+#: ../../mod/register.php:493
msgid ""
"If you are not familiar with OpenID, please leave that field blank and fill "
"in the rest of the items."
msgstr ""
-#: ../../mod/register.php:515
+#: ../../mod/register.php:494
msgid "Your OpenID (optional): "
msgstr ""
-#: ../../mod/register.php:529
+#: ../../mod/register.php:508
msgid "Include your profile in member directory?"
msgstr ""
-#: ../../mod/register.php:549
+#: ../../mod/register.php:528
msgid "Membership on this site is by invitation only."
msgstr ""
-#: ../../mod/register.php:550
+#: ../../mod/register.php:529
msgid "Your invitation ID: "
msgstr ""
-#: ../../mod/register.php:553 ../../mod/admin.php:405
+#: ../../mod/register.php:532 ../../mod/admin.php:405
msgid "Registration"
msgstr ""
-#: ../../mod/register.php:561
+#: ../../mod/register.php:540
msgid "Your Full Name (e.g. Joe Smith): "
msgstr ""
-#: ../../mod/register.php:562
+#: ../../mod/register.php:541
msgid "Your Email Address: "
msgstr ""
-#: ../../mod/register.php:563
+#: ../../mod/register.php:542
msgid ""
"Choose a profile nickname. This must begin with a text character. Your "
"profile address on this site will then be '<strong>nickname@$sitename</"
"strong>'."
msgstr ""
-#: ../../mod/register.php:564
+#: ../../mod/register.php:543
msgid "Choose a nickname: "
msgstr ""
-#: ../../mod/register.php:567 ../../include/nav.php:81 ../../boot.php:794
+#: ../../mod/register.php:546 ../../include/nav.php:81 ../../boot.php:794
msgid "Register"
msgstr ""
-#: ../../mod/dirfind.php:23
+#: ../../mod/dirfind.php:26
msgid "People Search"
msgstr ""
@@ -2860,38 +2860,38 @@ msgstr ""
msgid "Unable to locate original post."
msgstr ""
-#: ../../mod/item.php:249
+#: ../../mod/item.php:258
msgid "Empty post discarded."
msgstr ""
-#: ../../mod/item.php:372 ../../mod/wall_upload.php:99
+#: ../../mod/item.php:381 ../../mod/wall_upload.php:99
#: ../../mod/wall_upload.php:108 ../../mod/wall_upload.php:115
#: ../../include/message.php:144
msgid "Wall Photos"
msgstr ""
-#: ../../mod/item.php:781
+#: ../../mod/item.php:790
msgid "System error. Post not saved."
msgstr ""
-#: ../../mod/item.php:806
+#: ../../mod/item.php:815
#, php-format
msgid ""
"This message was sent to you by %s, a member of the Friendica social network."
msgstr ""
-#: ../../mod/item.php:808
+#: ../../mod/item.php:817
#, php-format
msgid "You may visit them online at %s"
msgstr ""
-#: ../../mod/item.php:809
+#: ../../mod/item.php:818
msgid ""
"Please contact the sender by replying to this post if you do not wish to "
"receive these messages."
msgstr ""
-#: ../../mod/item.php:811
+#: ../../mod/item.php:820
#, php-format
msgid "%s posted an update."
msgstr ""
@@ -3764,8 +3764,8 @@ msgstr ""
msgid "No installed applications."
msgstr ""
-#: ../../mod/search.php:83
-msgid "Search This Site"
+#: ../../mod/search.php:83 ../../include/text.php:650 ../../include/nav.php:91
+msgid "Search"
msgstr ""
#: ../../mod/profiles.php:21 ../../mod/profiles.php:375
@@ -4220,83 +4220,83 @@ msgid ""
"has already been approved."
msgstr ""
-#: ../../mod/dfrn_confirm.php:242
+#: ../../mod/dfrn_confirm.php:235
msgid "Response from remote site was not understood."
msgstr ""
-#: ../../mod/dfrn_confirm.php:251
+#: ../../mod/dfrn_confirm.php:244
msgid "Unexpected response from remote site: "
msgstr ""
-#: ../../mod/dfrn_confirm.php:259
+#: ../../mod/dfrn_confirm.php:252
msgid "Confirmation completed successfully."
msgstr ""
-#: ../../mod/dfrn_confirm.php:261 ../../mod/dfrn_confirm.php:275
-#: ../../mod/dfrn_confirm.php:282
+#: ../../mod/dfrn_confirm.php:254 ../../mod/dfrn_confirm.php:268
+#: ../../mod/dfrn_confirm.php:275
msgid "Remote site reported: "
msgstr ""
-#: ../../mod/dfrn_confirm.php:273
+#: ../../mod/dfrn_confirm.php:266
msgid "Temporary failure. Please wait and try again."
msgstr ""
-#: ../../mod/dfrn_confirm.php:280
+#: ../../mod/dfrn_confirm.php:273
msgid "Introduction failed or was revoked."
msgstr ""
-#: ../../mod/dfrn_confirm.php:425
+#: ../../mod/dfrn_confirm.php:418
msgid "Unable to set contact photo."
msgstr ""
-#: ../../mod/dfrn_confirm.php:482 ../../include/diaspora.php:507
+#: ../../mod/dfrn_confirm.php:475 ../../include/diaspora.php:507
#: ../../include/conversation.php:101
#, php-format
msgid "%1$s is now friends with %2$s"
msgstr ""
-#: ../../mod/dfrn_confirm.php:564
+#: ../../mod/dfrn_confirm.php:557
#, php-format
msgid "No user record found for '%s' "
msgstr ""
-#: ../../mod/dfrn_confirm.php:574
+#: ../../mod/dfrn_confirm.php:567
msgid "Our site encryption key is apparently messed up."
msgstr ""
-#: ../../mod/dfrn_confirm.php:585
+#: ../../mod/dfrn_confirm.php:578
msgid "Empty site URL was provided or URL could not be decrypted by us."
msgstr ""
-#: ../../mod/dfrn_confirm.php:606
+#: ../../mod/dfrn_confirm.php:599
msgid "Contact record was not found for you on our site."
msgstr ""
-#: ../../mod/dfrn_confirm.php:620
+#: ../../mod/dfrn_confirm.php:613
#, php-format
msgid "Site public key not available in contact record for URL %s."
msgstr ""
-#: ../../mod/dfrn_confirm.php:640
+#: ../../mod/dfrn_confirm.php:633
msgid ""
"The ID provided by your system is a duplicate on our system. It should work "
"if you try again."
msgstr ""
-#: ../../mod/dfrn_confirm.php:651
+#: ../../mod/dfrn_confirm.php:644
msgid "Unable to set your contact credentials on our system."
msgstr ""
-#: ../../mod/dfrn_confirm.php:716
+#: ../../mod/dfrn_confirm.php:709
msgid "Unable to update your contact profile details on our system"
msgstr ""
-#: ../../mod/dfrn_confirm.php:750
+#: ../../mod/dfrn_confirm.php:743
#, php-format
msgid "Connection accepted at %s"
msgstr ""
-#: ../../mod/dfrn_confirm.php:799
+#: ../../mod/dfrn_confirm.php:792
#, php-format
msgid "%1$s has joined %2$s"
msgstr ""
@@ -6257,10 +6257,6 @@ msgid_plural "%d Contacts"
msgstr[0] ""
msgstr[1] ""
-#: ../../include/text.php:650 ../../include/nav.php:91
-msgid "Search"
-msgstr ""
-
#: ../../include/text.php:831
msgid "Monday"
msgstr ""