From 3c168503834651b56b9b5de61621e8fbe958c298 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 11 Mar 2012 12:00:32 +0100 Subject: [PATCH 01/17] OpenID: display error msg if ID URL used to register an account does not exist --- include/auth.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/auth.php b/include/auth.php index fc52684e6..6a3e31cb7 100755 --- a/include/auth.php +++ b/include/auth.php @@ -117,10 +117,15 @@ else { // NOTREACHED } // new account - $_SESSION['register'] = 1; - $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); - $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); - goaway($openid->authUrl()); + try { + $_SESSION['register'] = 1; + $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); + $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); + goaway($openid->authUrl()); + } catch (Exception $e) { + // if the OpenID is misspelled we land here + notice( t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.

The error message was: ').$e->getMessage() ); + } // NOTREACHED } } From 6cbd765e1ff77a1efb01b1f096a875c881c43905 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 11 Mar 2012 12:03:47 +0100 Subject: [PATCH 02/17] Revert "OpenID: display error msg if ID URL used to register an account does not exist" This reverts commit 3c168503834651b56b9b5de61621e8fbe958c298. --- include/auth.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/include/auth.php b/include/auth.php index 6a3e31cb7..fc52684e6 100755 --- a/include/auth.php +++ b/include/auth.php @@ -117,15 +117,10 @@ else { // NOTREACHED } // new account - try { - $_SESSION['register'] = 1; - $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); - $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); - goaway($openid->authUrl()); - } catch (Exception $e) { - // if the OpenID is misspelled we land here - notice( t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.

The error message was: ').$e->getMessage() ); - } + $_SESSION['register'] = 1; + $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); + $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); + goaway($openid->authUrl()); // NOTREACHED } } From 29ade1d9b971bb14746bab5ec57db0e204c9e137 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 15 Mar 2012 10:51:22 +0100 Subject: [PATCH 03/17] another test for xmlify --- tests/xss_filter_test.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/xss_filter_test.php b/tests/xss_filter_test.php index d7dcf0472..3fb6ac310 100644 --- a/tests/xss_filter_test.php +++ b/tests/xss_filter_test.php @@ -27,11 +27,32 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { */ public function testXmlify() { $text="I want to break\n this!11!"; - $xml=xmlify($text); //test whether it actually may be part of a xml document + $xml=xmlify($text); $retext=unxmlify($text); $this->assertEquals($text, $retext); } + + /** + * xmlify and put in a document + */ + public function testXmlifyDocument() { + $tag="I want to break"; + $xml=xmlify($tag); + $text=''.$xml.''; + + $xml_parser=xml_parser_create(); + //should be possible to parse it + $values=array(); $index=array(); + $this->assertEquals(1, xml_parse_into_struct($xml_parser, $text, $values, $index)); + + $this->assertEquals(array('TEXT'=>array(0)), + $index); + $this->assertEquals(array(array('tag'=>'TEXT', 'type'=>'complete', 'level'=>1, 'value'=>$tag)), + $values); + + xml_parser_free($xml_parser); + } /** * test hex2bin and reverse From 9796e99fa8378758c4fe0f655b7c192f8fc1690f Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 15 Mar 2012 11:45:06 +0100 Subject: [PATCH 04/17] added simple build-in profiling --- boot.php | 2 +- database.sql | 11 ++++++++++- index.php | 1 + update.php | 16 ++++++++++++++++ util/profiler.php | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100755 util/profiler.php diff --git a/boot.php b/boot.php index b30f02c9f..e2494092d 100755 --- a/boot.php +++ b/boot.php @@ -11,7 +11,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1278' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1131 ); +define ( 'DB_UPDATE_VERSION', 1132 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 35c257f02..f8d4c7fc2 100755 --- a/database.sql +++ b/database.sql @@ -857,4 +857,13 @@ INDEX ( `ham` ), INDEX ( `term` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; - +CREATE TABLE IF NOT EXISTS `profiling` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY_KEY , +`function` VARCHAR(255) NOT NULL, +`file` VARCHAR(255) NOT NULL, +`line` INT NOT NULL DEFAULT '-1', +`class` VARCHAR(255), +`time` FLOAT(10, 2) NOT NULL, +INDEX(`function`), +INDEX(`file`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/index.php b/index.php index 5f6d74adb..688eee2ee 100755 --- a/index.php +++ b/index.php @@ -41,6 +41,7 @@ require_once("dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); unset($db_host, $db_user, $db_pass, $db_data); +require_once('util/profiler.php'); if(! $install) { diff --git a/update.php b/update.php index c29394b48..36116341a 100755 --- a/update.php +++ b/update.php @@ -1122,3 +1122,19 @@ function update_1130() { q("ALTER TABLE `item` ADD `file` MEDIUMTEXT NOT NULL AFTER `inform`, ADD FULLTEXT KEY (`file`) "); } +/** + * CREATE TABLE for profiling + */ +function update_1132() { + q("CREATE TABLE IF NOT EXISTS `profiling` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY_KEY , +`function` VARCHAR(255) NOT NULL, +`file` VARCHAR(255) NOT NULL, +`line` INT NOT NULL DEFAULT '-1', +`class` VARCHAR(255), +`time` FLOAT(10, 2) NOT NULL, +INDEX(`function`), +INDEX(`file`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; "); +} + diff --git a/util/profiler.php b/util/profiler.php new file mode 100755 index 000000000..3a3de5373 --- /dev/null +++ b/util/profiler.php @@ -0,0 +1,36 @@ + Date: Thu, 15 Mar 2012 12:55:49 +0100 Subject: [PATCH 05/17] integrated profiler --- database.sql | 18 +++++++++--------- update.php | 22 +++++++++++----------- util/profiler.php | 27 ++++++--------------------- 3 files changed, 26 insertions(+), 41 deletions(-) diff --git a/database.sql b/database.sql index f8d4c7fc2..e07e9e070 100755 --- a/database.sql +++ b/database.sql @@ -858,12 +858,12 @@ INDEX ( `term` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `profiling` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY_KEY , -`function` VARCHAR(255) NOT NULL, -`file` VARCHAR(255) NOT NULL, -`line` INT NOT NULL DEFAULT '-1', -`class` VARCHAR(255), -`time` FLOAT(10, 2) NOT NULL, -INDEX(`function`), -INDEX(`file`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`function` VARCHAR( 255 ) NOT NULL , +`file` VARCHAR( 255 ) NOT NULL , +`line` INT NOT NULL DEFAULT '-1', +`class` VARCHAR( 255 ) NOT NULL , +`time` FLOAT( 10, 2 ) NOT NULL , +INDEX ( `function` ) , +INDEX ( `file` ) +) ENGINE = MyISAM DEFAULT CHARSET=utf8; diff --git a/update.php b/update.php index 36116341a..8c8a2a5e4 100755 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Thu, 22 Mar 2012 01:46:52 -0700 Subject: [PATCH 06/17] prevent re-registrations using a deleted username - not an issue with Friendica but could create a serious privacy issue with federated platforms --- boot.php | 2 +- database.sql | 6 ++++++ include/Contact.php | 6 ++++++ mod/register.php | 10 ++++++++++ mod/regmod.php | 5 +++++ update.php | 11 ++++++++++- 6 files changed, 38 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 910de6f82..04e16e64d 100755 --- a/boot.php +++ b/boot.php @@ -11,7 +11,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1288' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1132 ); +define ( 'DB_UPDATE_VERSION', 1133 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index f058bc59e..327b482c0 100755 --- a/database.sql +++ b/database.sql @@ -861,3 +861,9 @@ INDEX ( `term` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `userd` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`username` CHAR( 255 ) NOT NULL, +INDEX ( `username` ) +) ENGINE = MyISAM DEFAULT CHARSET=utf8; + diff --git a/include/Contact.php b/include/Contact.php index baccea305..d9949b1ef 100755 --- a/include/Contact.php +++ b/include/Contact.php @@ -15,6 +15,12 @@ function user_remove($uid) { call_hooks('remove_user',$r[0]); + // save username (actually the nickname as it is guaranteed + // unique), so it cannot be re-registered in the future. + + q("insert into userd ( username ) values ( '%s' )", + $r[0]['nickname'] + ); q("DELETE FROM `contact` WHERE `uid` = %d", intval($uid)); q("DELETE FROM `group` WHERE `uid` = %d", intval($uid)); diff --git a/mod/register.php b/mod/register.php index 388b3e250..6d0e2700b 100755 --- a/mod/register.php +++ b/mod/register.php @@ -150,6 +150,16 @@ function register_post(&$a) { if(count($r)) $err .= t('Nickname is already registered. Please choose another.') . EOL; + // Check deleted accounts that had this nickname. Doesn't matter to us, + // but could be a security issue for federated platforms. + + $r = q("SELECT * FROM `userd` + WHERE `username` = '%s' LIMIT 1", + dbesc($nickname) + ); + if(count($r)) + $err .= t('Nickname was once registered here and may not be re-used. Please choose another.') . EOL; + if(strlen($err)) { notice( $err ); return; diff --git a/mod/regmod.php b/mod/regmod.php index 17e728ba2..21f41eb01 100755 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -64,6 +64,11 @@ function user_allow($hash) { } + +// This does not have to go through user_remove() and save the nickname +// permanently against re-registration, as the person was not yet +// allowed to have friends on this system + function user_deny($hash) { $register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1", diff --git a/update.php b/update.php index 6a685a6ff..a69742a94 100755 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Thu, 22 Mar 2012 04:07:37 -0700 Subject: [PATCH 07/17] missing tooltip for "file as" --- view/theme/comix-plain/wall_item.tpl | 2 +- view/theme/comix-plain/wallwall_item.tpl | 2 +- view/theme/comix/wall_item.tpl | 2 +- view/theme/comix/wallwall_item.tpl | 2 +- view/theme/duepuntozero/wall_item.tpl | 2 +- view/theme/duepuntozero/wallwall_item.tpl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/view/theme/comix-plain/wall_item.tpl b/view/theme/comix-plain/wall_item.tpl index dae16a1c7..dfcd8ca96 100755 --- a/view/theme/comix-plain/wall_item.tpl +++ b/view/theme/comix-plain/wall_item.tpl @@ -58,7 +58,7 @@ {{ endif }} {{ if $item.filer }} - + {{ endif }}
{{ if $item.drop.dropping }}{{ endif }} diff --git a/view/theme/comix-plain/wallwall_item.tpl b/view/theme/comix-plain/wallwall_item.tpl index 11decf9c4..abd5967b2 100755 --- a/view/theme/comix-plain/wallwall_item.tpl +++ b/view/theme/comix-plain/wallwall_item.tpl @@ -62,7 +62,7 @@ {{ endif }} {{ if $item.filer }} - + {{ endif }}
diff --git a/view/theme/comix/wall_item.tpl b/view/theme/comix/wall_item.tpl index dae16a1c7..dfcd8ca96 100755 --- a/view/theme/comix/wall_item.tpl +++ b/view/theme/comix/wall_item.tpl @@ -58,7 +58,7 @@ {{ endif }} {{ if $item.filer }} - + {{ endif }}
{{ if $item.drop.dropping }}{{ endif }} diff --git a/view/theme/comix/wallwall_item.tpl b/view/theme/comix/wallwall_item.tpl index 11decf9c4..abd5967b2 100755 --- a/view/theme/comix/wallwall_item.tpl +++ b/view/theme/comix/wallwall_item.tpl @@ -62,7 +62,7 @@ {{ endif }} {{ if $item.filer }} - + {{ endif }}
diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl index e2db70a14..9d1dd7d70 100755 --- a/view/theme/duepuntozero/wall_item.tpl +++ b/view/theme/duepuntozero/wall_item.tpl @@ -58,7 +58,7 @@ {{ endif }} {{ if $item.filer }} - + {{ endif }}
{{ if $item.drop.dropping }}{{ endif }} diff --git a/view/theme/duepuntozero/wallwall_item.tpl b/view/theme/duepuntozero/wallwall_item.tpl index 420c0e08b..bad5680c7 100755 --- a/view/theme/duepuntozero/wallwall_item.tpl +++ b/view/theme/duepuntozero/wallwall_item.tpl @@ -62,7 +62,7 @@ {{ endif }} {{ if $item.filer }} - + {{ endif }}
From 54c08b2b0fcd20522b05162ee782e2c7e09aced9 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 22 Mar 2012 12:41:51 +0100 Subject: [PATCH 08/17] adding filer functionality to quattro(-green) --- view/wall_item.tpl | 3 +++ view/wallwall_item.tpl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/view/wall_item.tpl b/view/wall_item.tpl index c99077510..1c19c4b60 100755 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -51,6 +51,9 @@ $item.star.undo $item.star.tagger {{ endif }} + {{ if $item.filer }} + file as + {{ endif }} {{ if $item.vote }} $item.vote.like.1 diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index be942f261..e12a5fbd7 100755 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -58,6 +58,9 @@ $item.star.tagger {{ endif }} + {{ if $item.filer }} + file as + {{ endif }} {{ if $item.vote }} $item.vote.like.1 From f208e7af3620cb38eb5617896d788d1be61e6851 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 22 Mar 2012 12:43:03 +0100 Subject: [PATCH 09/17] tests for the template engine --- include/template_processor.php | 2 +- tests/template_test.php | 224 +++++++++++++++++++++++++++++++++ 2 files changed, 225 insertions(+), 1 deletion(-) create mode 100755 tests/template_test.php diff --git a/include/template_processor.php b/include/template_processor.php index 8671587fc..06c49a708 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -80,7 +80,7 @@ */ private function _replcb_for($args){ $m = array_map('trim', explode(" as ", $args[2])); - list($keyname, $varname) = explode("=>",$m[1]); + @list($keyname, $varname) = explode("=>",$m[1]); if (is_null($varname)) { $varname=$keyname; $keyname=""; } if ($m[0]=="" || $varname=="" || is_null($varname)) die("template error: 'for ".$m[0]." as ".$varname."'") ; //$vals = $this->r[$m[0]]; diff --git a/tests/template_test.php b/tests/template_test.php new file mode 100755 index 000000000..1f9f80531 --- /dev/null +++ b/tests/template_test.php @@ -0,0 +1,224 @@ +assertTrue(is_null($second)); + } + + public function testSimpleVariableString() { + $tpl='Hello $name!'; + + $text=replace_macros($tpl, array('$name'=>'Anna')); + + $this->assertEquals('Hello Anna!', $text); + } + + public function testSimpleVariableInt() { + $tpl='There are $num new messages!'; + + $text=replace_macros($tpl, array('$num'=>172)); + + $this->assertEquals('There are 172 new messages!', $text); + } + + public function testConditionalElse() { + $tpl='There{{ if $num!=1 }} are $num new messages{{ else }} is 1 new message{{ endif }}!'; + + $text1=replace_macros($tpl, array('$num'=>1)); + $text22=replace_macros($tpl, array('$num'=>22)); + + $this->assertEquals('There is 1 new message!', $text1); + $this->assertEquals('There are 22 new messages!', $text22); + } + + public function testConditionalNoElse() { + $tpl='{{ if $num!=0 }}There are $num new messages!{{ endif }}'; + + $text0=replace_macros($tpl, array('$num'=>0)); + $text22=replace_macros($tpl, array('$num'=>22)); + + $this->assertEquals('', $text0); + $this->assertEquals('There are 22 new messages!', $text22); + } + + public function testConditionalFail() { + $tpl='There {{ if $num!=1 }} are $num new messages{{ else }} is 1 new message{{ endif }}!'; + + $text1=replace_macros($tpl, array()); + + //$this->assertEquals('There is 1 new message!', $text1); + } + + public function testSimpleFor() { + $tpl='{{ for $messages as $message }} $message {{ endfor }}'; + + $text=replace_macros($tpl, array('$messages'=>array('message 1', 'message 2'))); + + $this->assertEquals(' message 1 message 2 ', $text); + } + + public function testFor() { + $tpl='{{ for $messages as $message }} from: $message.from to $message.to {{ endfor }}'; + + $text=replace_macros($tpl, array('$messages'=>array(array('from'=>'Mike', 'to'=>'Alex'), array('from'=>'Alex', 'to'=>'Mike')))); + + $this->assertEquals(' from: Mike to Alex from: Alex to Mike ', $text); + } + + public function testKeyedFor() { + $tpl='{{ for $messages as $from=>$to }} from: $from to $to {{ endfor }}'; + + $text=replace_macros($tpl, array('$messages'=>array('Mike'=>'Alex', 'Sven'=>'Mike'))); + + $this->assertEquals(' from: Mike to Alex from: Sven to Mike ', $text); + } + + public function testForEmpty() { + $tpl='messages: {{for $messages as $message}} from: $message.from to $message.to {{ endfor }}'; + + $text=replace_macros($tpl, array('$messages'=>array())); + + $this->assertEquals('messages: ', $text); + } + + public function testForWrongType() { + $tpl='messages: {{for $messages as $message}} from: $message.from to $message.to {{ endfor }}'; + + $text=replace_macros($tpl, array('$messages'=>11)); + + $this->assertEquals('messages: ', $text); + } + + public function testForConditional() { + $tpl='new messages: {{for $messages as $message}}{{ if $message.new }} $message.text{{endif}}{{ endfor }}'; + + $text=replace_macros($tpl, array('$messages'=>array( + array('new'=>true, 'text'=>'new message'), + array('new'=>false, 'text'=>'old message')))); + + $this->assertEquals('new messages: new message', $text); + } + + public function testConditionalFor() { + $tpl='{{ if $enabled }}new messages:{{for $messages as $message}} $message.text{{ endfor }}{{endif}}'; + + $text=replace_macros($tpl, array('$enabled'=>true, + '$messages'=>array( + array('new'=>true, 'text'=>'new message'), + array('new'=>false, 'text'=>'old message')))); + + $this->assertEquals('new messages: new message old message', $text); + } + + public function testFantasy() { + $tpl='Fantasy: {{fantasy $messages}}'; + + $text=replace_macros($tpl, array('$messages'=>'no no')); + + $this->assertEquals('Fantasy: {{fantasy no no}}', $text); + } + + public function testInc() { + $tpl='{{inc field_input.tpl with $field=$myvar}}{{ endinc }}'; + + $text=replace_macros($tpl, array('$myvar'=>array('myfield', 'label', 'value', 'help'))); + + $this->assertEquals(" \n" + ."
\n" + ." \n" + ." \n" + ." help\n" + ."
\n", $text); + } + + public function testIncNoVar() { + $tpl='{{inc field_input.tpl }}{{ endinc }}'; + + $text=replace_macros($tpl, array('$field'=>array('myfield', 'label', 'value', 'help'))); + + $this->assertEquals(" \n
\n \n" + ." \n" + ." help\n" + ."
\n", $text); + } + + public function testDoubleUse() { + $tpl='Hello $name! {{ if $enabled }} I love you! {{ endif }}'; + + $text=replace_macros($tpl, array('$name'=>'Anna', '$enabled'=>false)); + + $this->assertEquals('Hello Anna! ', $text); + + $tpl='Hey $name! {{ if $enabled }} I hate you! {{ endif }}'; + + $text=replace_macros($tpl, array('$name'=>'Max', '$enabled'=>true)); + + $this->assertEquals('Hey Max! I hate you! ', $text); + } + + public function testIncDouble() { + $tpl='{{inc field_input.tpl with $field=$var1}}{{ endinc }}' + .'{{inc field_input.tpl with $field=$var2}}{{ endinc }}'; + + $text=replace_macros($tpl, array('$var1'=>array('myfield', 'label', 'value', 'help'), + '$var2'=>array('myfield2', 'label2', 'value2', 'help2'))); + + $this->assertEquals(" \n" + ."
\n" + ." \n" + ." \n" + ." help\n" + ."
\n" + ." \n" + ."
\n" + ." \n" + ." \n" + ." help2\n" + ."
\n", $text); + } +} \ No newline at end of file From 29900febb341cfbec6e4445d4ea1c2dc782a521a Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 22 Mar 2012 12:45:11 +0100 Subject: [PATCH 10/17] removed problem from previous commit --- .htaccess | 3 --- 1 file changed, 3 deletions(-) diff --git a/.htaccess b/.htaccess index 5f9531a7e..1df509670 100755 --- a/.htaccess +++ b/.htaccess @@ -5,9 +5,6 @@ AddType audio/ogg .oga Deny from all - -Deny from all - RewriteEngine on From ad9d0dadb3ade47d9ecbe5a0ffea12a8f9c4a96d Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 22 Mar 2012 12:52:24 +0100 Subject: [PATCH 11/17] removed unneccessary stuff --- index.php | 2 -- util/profiler.php | 21 --------------------- 2 files changed, 23 deletions(-) delete mode 100755 util/profiler.php diff --git a/index.php b/index.php index 688eee2ee..c82b20386 100755 --- a/index.php +++ b/index.php @@ -41,8 +41,6 @@ require_once("dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); unset($db_host, $db_user, $db_pass, $db_data); -require_once('util/profiler.php'); - if(! $install) { /** diff --git a/util/profiler.php b/util/profiler.php deleted file mode 100755 index fe33fe429..000000000 --- a/util/profiler.php +++ /dev/null @@ -1,21 +0,0 @@ - Date: Thu, 22 Mar 2012 13:03:28 +0100 Subject: [PATCH 12/17] removed some new lines to cut down number of changed files --- boot.php | 1 - index.php | 1 + update.php | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 9fc9b7f7e..04e16e64d 100755 --- a/boot.php +++ b/boot.php @@ -9,7 +9,6 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); - define ( 'FRIENDICA_VERSION', '2.3.1288' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1133 ); diff --git a/index.php b/index.php index c82b20386..139f0a38b 100755 --- a/index.php +++ b/index.php @@ -41,6 +41,7 @@ require_once("dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); unset($db_host, $db_user, $db_pass, $db_data); + if(! $install) { /** diff --git a/update.php b/update.php index 6231943ec..a69742a94 100755 --- a/update.php +++ b/update.php @@ -1,6 +1,5 @@ Date: Thu, 22 Mar 2012 13:05:34 +0100 Subject: [PATCH 13/17] new lines removed --- database.sql | 1 + index.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/database.sql b/database.sql index 13a401464..327b482c0 100755 --- a/database.sql +++ b/database.sql @@ -860,6 +860,7 @@ INDEX ( `ham` ), INDEX ( `term` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `userd` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` CHAR( 255 ) NOT NULL, diff --git a/index.php b/index.php index 139f0a38b..5f6d74adb 100755 --- a/index.php +++ b/index.php @@ -41,7 +41,7 @@ require_once("dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); unset($db_host, $db_user, $db_pass, $db_data); - + if(! $install) { /** From 6df7fae4b57540aa13c9f25976543a8511c61626 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 22 Mar 2012 13:41:41 +0100 Subject: [PATCH 14/17] non static filer text --- view/wall_item.tpl | 2 +- view/wallwall_item.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/wall_item.tpl b/view/wall_item.tpl index 1c19c4b60..e158e5ef8 100755 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -52,7 +52,7 @@ $item.star.tagger {{ endif }} {{ if $item.filer }} - file as + $item.star.filer {{ endif }} {{ if $item.vote }} diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index e12a5fbd7..f47b47112 100755 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -59,7 +59,7 @@ {{ endif }} {{ if $item.filer }} - file as + $item.star.filer {{ endif }} {{ if $item.vote }} From 1e86e3fb26271a687721ed6e74055feb38b363fa Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 22 Mar 2012 13:46:05 +0100 Subject: [PATCH 15/17] it's only item.filer ;-) --- view/wall_item.tpl | 2 +- view/wallwall_item.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/wall_item.tpl b/view/wall_item.tpl index e158e5ef8..e771db068 100755 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -52,7 +52,7 @@ $item.star.tagger {{ endif }} {{ if $item.filer }} - $item.star.filer + $item.filer {{ endif }} {{ if $item.vote }} diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index f47b47112..693ebaba6 100755 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -59,7 +59,7 @@ {{ endif }} {{ if $item.filer }} - $item.star.filer + $item.filer {{ endif }} {{ if $item.vote }} From 07c5b0af5a09e4628b428da6071d189656d55b32 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 22 Mar 2012 14:09:21 +0100 Subject: [PATCH 16/17] quattro(-green) styling the 'filed under: remove' text --- view/theme/quattro-green/colors.less | 2 ++ view/theme/quattro-green/style.css | 43 +++++++++++++++++++++++++--- view/theme/quattro/quattro.less | 8 ++++-- view/theme/quattro/style.css | 6 +++- 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/view/theme/quattro-green/colors.less b/view/theme/quattro-green/colors.less index 57fd2ef60..9eee19f4c 100755 --- a/view/theme/quattro-green/colors.less +++ b/view/theme/quattro-green/colors.less @@ -72,6 +72,8 @@ @NoticeColor: @Grey1; @NoticeBackgroundColor: #511919; +@FieldHelpColor: @Grey3; + @ThreadBackgroundColor: #f6f7f8; @ShinyBorderColor: @Green4; diff --git a/view/theme/quattro-green/style.css b/view/theme/quattro-green/style.css index 301477679..2f463c96c 100755 --- a/view/theme/quattro-green/style.css +++ b/view/theme/quattro-green/style.css @@ -615,7 +615,7 @@ aside #profiles-menu { } #contact-block .contact-block-content { clear: both; - overflow: idden; + overflow: hidden; height: auto; } #contact-block .contact-block-link { @@ -623,7 +623,7 @@ aside #profiles-menu { margin: 0px 2px 2px 0px; } #contact-block .contact-block-link img { - widht: 48px; + width: 48px; height: 48px; } /* mail view */ @@ -787,7 +787,7 @@ section { } .wall-item-decor { position: absolute; - left: 790px; + left: 97%; top: -10px; width: 16px; } @@ -968,6 +968,10 @@ section { background: url("../../../images/tag.png") no-repeat center right; color: #ffffff; } +.filesavetags { + padding: 3px 0px 3px 0px; + opacity: 0.5; +} .wwto { position: absolute !important; width: 25px; @@ -1304,6 +1308,37 @@ ul.tabs li { ul.tabs li .active { border-bottom: 1px solid #009100; } +/** group editor **/ +#group-edit-desc { + margin-top: 1em; + color: #999999; +} +#group-update-wrapper { + height: auto; + overflow: auto; +} +#group-update-wrapper #group { + width: 300px; + float: left; + margin-right: 20px; +} +#group-update-wrapper #contacts { + width: 300px; + float: left; +} +#group-update-wrapper #group-separator { + display: none; +} +#group-update-wrapper .contact_list { + height: 300px; + border: 1px solid #364e59; + overflow: auto; +} +#group-update-wrapper .contact_list .contact-block-div { + width: 50px; + height: 50px; + float: left; +} /** * Form fields */ @@ -1326,7 +1361,7 @@ ul.tabs li .active { .field .field_help { display: block; margin-left: 200px; - color: #666666; + color: #999999; } .field .onoff { float: left; diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 27c48f195..fca65c907 100755 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -113,7 +113,7 @@ header { #banner { overflow: hidden; - text-align: center; + text-align: center; width: 100%; a, a:active, a:visited, a:link, a:hover { color: @Grey1; text-decoration: none; outline: none; vertical-align: bottom; } #logo-img { height: 22px; margin-top:5px;} @@ -448,7 +448,7 @@ section { margin-bottom: 20px; width: 780px; } -.wall-item-decor { position: absolute; left: 790px; top: -10px; width: 16px;} +.wall-item-decor { position: absolute; left: 97%; top: -10px; width: 16px;} .unstarred { display: none; } .wall-item-container { @@ -570,6 +570,10 @@ section { color: @TagColor; } } +.filesavetags { + padding: 3px 0px 3px 0px; + opacity: 0.5; +} .wwto { position: absolute !important; diff --git a/view/theme/quattro/style.css b/view/theme/quattro/style.css index 6087e4cd1..8f0abe86d 100755 --- a/view/theme/quattro/style.css +++ b/view/theme/quattro/style.css @@ -787,7 +787,7 @@ section { } .wall-item-decor { position: absolute; - left: 790px; + left: 97%; top: -10px; width: 16px; } @@ -968,6 +968,10 @@ section { background: url("../../../images/tag.png") no-repeat center right; color: #ffffff; } +.filesavetags { + padding: 3px 0px 3px 0px; + opacity: 0.5; +} .wwto { position: absolute !important; width: 25px; From 40d19d5b8c34cdb2ad6d605e85206bbe57c0be13 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 22 Mar 2012 06:19:27 -0700 Subject: [PATCH 17/17] normalise comparison link on delegation page --- mod/delegate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/delegate.php b/mod/delegate.php index c19df0681..8c5031859 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -86,7 +86,7 @@ function delegate_content(&$a) { $r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s' and contact.uid = %d and contact.self = 0 and network = '%s' ", - dbesc($a->get_baseurl()), + dbesc(normalise_link($a->get_baseurl())), intval(local_user()), dbesc(NETWORK_DFRN) );