aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/crypto.php28
-rw-r--r--mod/home.php11
-rw-r--r--mod/item.php44
-rw-r--r--view/css/default.css6
-rw-r--r--view/php/default.php2
-rw-r--r--view/theme/redbasic/css/style.css12
-rw-r--r--view/theme/redbasic/php/style.php9
7 files changed, 45 insertions, 67 deletions
diff --git a/include/crypto.php b/include/crypto.php
index a4ce2cf98..494a2a5b9 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -296,34 +296,6 @@ function salmon_key($pubkey) {
return 'RSA' . '.' . base64url_encode($m,true) . '.' . base64url_encode($e,true) ;
}
-// old function for providing mysql compatible encryption and is also
-// used in Friendica 'RINO'. This function is messy and should be retired.
-
-
-function aes_decrypt($val,$ky)
-{
- $key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
- for($a=0;$a<strlen($ky);$a++)
- $key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
- $mode = MCRYPT_MODE_ECB;
- $enc = MCRYPT_RIJNDAEL_128;
- $dec = @mcrypt_decrypt($enc, $key, $val, $mode, @mcrypt_create_iv( @mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM ) );
- return rtrim($dec,(( ord(substr($dec,strlen($dec)-1,1))>=0 and ord(substr($dec, strlen($dec)-1,1))<=16)? chr(ord( substr($dec,strlen($dec)-1,1))):null));
-}
-
-
-
-function aes_encrypt($val,$ky)
-{
- $key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
- for($a=0;$a<strlen($ky);$a++)
- $key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
- $mode=MCRYPT_MODE_ECB;
- $enc=MCRYPT_RIJNDAEL_128;
- $val=str_pad($val, (16*(floor(strlen($val) / 16)+(strlen($val) % 16==0?2:1))), chr(16-(strlen($val) % 16)));
- return mcrypt_encrypt($enc, $key, $val, $mode, mcrypt_create_iv( mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM));
-}
-
function z_obscure($s) {
return json_encode(crypto_encapsulate($s,get_config('system','pubkey')));
}
diff --git a/mod/home.php b/mod/home.php
index b2779051d..242b2dcec 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -72,13 +72,10 @@ function home_content(&$a, $update = 0, $load = false) {
if($sitename)
$o .= '<h1>' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>';
- if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
- // If there's nothing special happening, just spit out a login box
- $loginbox = get_config('system','login_on_homepage');
- if(intval($loginbox) || $loginbox === false)
- $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
- }
+ $loginbox = get_config('system','login_on_homepage');
+ if(intval($loginbox) || $loginbox === false)
+ $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o;
-} \ No newline at end of file
+}
diff --git a/mod/item.php b/mod/item.php
index 94b32d01c..d631bd1f2 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -581,27 +581,6 @@ function item_post(&$a) {
}
}
- $attachments = '';
- $match = false;
-
- if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) {
- $attachments = array();
- foreach($match[2] as $mtch) {
- $hash = substr($mtch,0,strpos($mtch,','));
- $rev = intval(substr($mtch,strpos($mtch,',')));
- $r = attach_by_hash_nodata($hash,$rev);
- if($r['success']) {
- $attachments[] = array(
- 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'],
- 'length' => $r['data']['filesize'],
- 'type' => $r['data']['filetype'],
- 'title' => urlencode($r['data']['filename']),
- 'revision' => $r['data']['revision']
- );
- }
- $body = str_replace($match[1],'',$body);
- }
- }
/**
*
@@ -638,6 +617,29 @@ function item_post(&$a) {
}
+
+ $attachments = '';
+ $match = false;
+
+ if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) {
+ $attachments = array();
+ foreach($match[2] as $mtch) {
+ $hash = substr($mtch,0,strpos($mtch,','));
+ $rev = intval(substr($mtch,strpos($mtch,',')));
+ $r = attach_by_hash_nodata($hash,$rev);
+ if($r['success']) {
+ $attachments[] = array(
+ 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'],
+ 'length' => $r['data']['filesize'],
+ 'type' => $r['data']['filetype'],
+ 'title' => urlencode($r['data']['filename']),
+ 'revision' => $r['data']['revision']
+ );
+ }
+ $body = str_replace($match[1],'',$body);
+ }
+ }
+
}
// BBCODE end alert
diff --git a/view/css/default.css b/view/css/default.css
index 56173f932..2675bc2d8 100644
--- a/view/css/default.css
+++ b/view/css/default.css
@@ -14,10 +14,8 @@ main {
height: 100%;
}
-aside#region_1 {
- width: 231px;
- min-width: 231px;
- max-width: 231px;
+aside#region_1,
+aside#region_3 {
display: table-cell;
vertical-align: top;
padding: 65px 7px 0px 7px;
diff --git a/view/php/default.php b/view/php/default.php
index 01cd8a0d4..4c8311ef0 100644
--- a/view/php/default.php
+++ b/view/php/default.php
@@ -14,7 +14,7 @@
<div id="page-footer"></div>
<div id="pause"></div>
</section>
- <aside id="region_3"><?php if(x($page,'right_aside')) echo $page['right_aside']; ?></aside>
+ <aside id="region_3" class="hidden-sm hidden-xs"><?php if(x($page,'right_aside')) echo $page['right_aside']; ?></aside>
</main>
<footer><?php if(x($page,'footer')) echo $page['footer']; ?></footer>
</body>
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index a671a6671..1c575a63e 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -24,8 +24,14 @@ body {
height: 100%;
}
+aside {
+ width: $aside_widthpx;
+ min-width: $aside_widthpx;
+ max-width: $aside_widthpx;
+}
+
main {
- max-width: $main_width;
+ max-width: $main_widthpx;
}
h1, .h1, h2, .h2 {
@@ -2097,8 +2103,8 @@ nav .badge.mail-update:hover {
}
main {
- left: -231px;
- width: calc( 100% + 231px );
+ left: -$aside_widthpx;
+ width: calc( 100% + $aside_widthpx );
}
main.region_1-on {
diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php
index c6231e690..5a28fc4e3 100644
--- a/view/theme/redbasic/php/style.php
+++ b/view/theme/redbasic/php/style.php
@@ -153,11 +153,13 @@ if(file_exists('view/theme/redbasic/css/style.css')) {
$x = file_get_contents('view/theme/redbasic/css/style.css');
- // left aside is 231px + converse width
- $main_width = (231 + intval($converse_width));
+ $aside_width = 231;
+
+ // left aside and right aside are is 231px + converse width
+ $main_width = (($aside_width * 2) + intval($converse_width));
// prevent main_width smaller than 768px
- $main_width = (($main_width < 768) ? 768 : $main_width) . 'px';
+ $main_width = (($main_width < 768) ? 768 : $main_width);
$options = array (
'$nav_bg' => $nav_bg,
@@ -191,6 +193,7 @@ if(file_exists('view/theme/redbasic/css/style.css')) {
'$pmenu_reply' => $pmenu_reply,
'$comment_indent' => $comment_indent,
'$main_width' => $main_width,
+ '$aside_width' => $aside_width
);
echo str_replace(array_keys($options), array_values($options), $x);