]> git.mxchange.org Git - friendica.git/commitdiff
enhance random_string, block public email replies
authorFriendika <info@friendika.com>
Thu, 11 Aug 2011 04:06:35 +0000 (21:06 -0700)
committerFriendika <info@friendika.com>
Thu, 11 Aug 2011 04:06:35 +0000 (21:06 -0700)
boot.php
include/group.php
include/main.js
include/poller.php
include/text.php

index 3b8c27f6025e560ba8003d4dfb74bfce6eeb84c2..ea304b1e8cc6e10f6ac12413058a69a27029fe40 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -7,7 +7,7 @@ require_once('include/text.php');
 require_once("include/pgettext.php");
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1067' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1068' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1079      );
 
index 8ee7face6d9a132dfee7e6a6373fe309fc5650ba..1ebae7b7b07f8a02e2e674f2cc133def7d94bb3a 100644 (file)
@@ -170,7 +170,7 @@ EOT;
                        $o .= ' <li class="sidebar-group-li">' 
                        . (($edit) ? "<a href=\"group/{$rr['id']}\" title=\"" . t('Edit') 
                                . "\" ><img src=\"images/spencil.gif\" alt=\"" . t('Edit') . "\"></a> " : "") 
-                       . (($cid) ? '<input type="checkbox" onclick="contactgroupChangeMember(' . $rr['id'] . ',' . $cid . ');return true;" '
+                       . (($cid) ? '<input type="checkbox" class="' . (($selected) ? 'ticked' : 'unticked') . '" onclick="contactgroupChangeMember(' . $rr['id'] . ',' . $cid . ');return true;" '
                                . ((in_array($rr['id'],$member_of)) ? ' checked="checked" ' : '') . '/>' : '')
                        . "<a href=\"$each/{$rr['id']}\" $selected >{$rr['name']}</a></li>\r\n";
                }
index e5c78a0654a2bcad8dd0a9a7d05678bba6fcf354..6db1f417957aa8ee07b7a7803e2aabaab7dd4731 100644 (file)
        function contactgroupChangeMember(gid,cid) {
                $('body').css('cursor', 'wait');
                $.get('contactgroup/' + gid + '/' + cid, function(data) {
-                               $('body').css('cursor', 'auto');                                
+                               $('body').css('cursor', 'auto');
                });
        }
 
@@ -402,3 +402,4 @@ Array.prototype.remove = function(item) {
   this.length = from < 0 ? this.length + from : from;
   return this.push.apply(this, rest);
 };
+
index 611dd20bf0234f26934a2d22920dce1f0e8bfcca..6ac99fc7d0cf5304721a2ba449769499970202aa 100644 (file)
@@ -421,6 +421,8 @@ function poller_run($argv, $argc){
                                                        $datarray['contact-id'] = $contact['id'];
                                                        if($datarray['parent-uri'] === $datarray['uri'])
                                                                $datarray['private'] = 1;
+                                                       if(! get_pconfig($importer_uid,'system','allow_public_email_replies'))
+                                                               $datarray['private'] = 1;
                                                        $datarray['author-name'] = $contact['name'];
                                                        $datarray['author-link'] = 'mailbox';
                                                        $datarray['author-avatar'] = $contact['photo'];
index 0641689d5091d3ac049fac54af66b300c9d7a7dc..aeb20bb0f9f2db96bcdc313f459443872a24ef70 100644 (file)
@@ -19,11 +19,18 @@ function replace_macros($s,$r) {
 }}
 
 
-// random hex string, 64 chars max
+// random string, there are 86 characters max in text mode, 128 for hex
+// output is urlsafe
+
+define('RANDOM_STRING_HEX',  0x00 );
+define('RANDOM_STRING_TEXT', 0x01 );
 
 if(! function_exists('random_string')) {
-function random_string($size = 64) {
-       return(substr(hash('sha256',uniqid(rand(),true)),0,$size));
+function random_string($size = 64,$type = RANDOM_STRING_HEX) {
+       // generate a bit of entropy and run it through the whirlpool
+       $s = hash('whirlpool', (string) rand() . uniqid(rand(),true) . (string) rand(),(($type == RANDOM_STRING_TEXT) ? true : false));
+       $s = (($type == RANDOM_STRING_TEXT) ? str_replace("\n","",base64url_encode($s,true)) : $s);
+       return(substr($s,0,$size));
 }}
 
 /**