From ba10833bc5ae0afb51d2fc6609370865386678fb Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sun, 25 Jan 2015 04:16:28 +0100 Subject: Check allowed emails, also add blacklisting for not allowed emails: config:'system','not_allowed_email' --- doc/html/classRedMatrix_1_1Import_1_1Import.html | 447 ----------------------- doc/html/classRedmatrix_1_1Import_1_1Import.js | 18 - doc/html/namespaceRedmatrix_1_1Import.html | 120 ------ doc/html/namespaceRedmatrix_1_1Import.js | 4 - include/network.php | 35 +- 5 files changed, 29 insertions(+), 595 deletions(-) delete mode 100644 doc/html/classRedMatrix_1_1Import_1_1Import.html delete mode 100644 doc/html/classRedmatrix_1_1Import_1_1Import.js delete mode 100644 doc/html/namespaceRedmatrix_1_1Import.html delete mode 100644 doc/html/namespaceRedmatrix_1_1Import.js diff --git a/doc/html/classRedMatrix_1_1Import_1_1Import.html b/doc/html/classRedMatrix_1_1Import_1_1Import.html deleted file mode 100644 index 2119780c3..000000000 --- a/doc/html/classRedMatrix_1_1Import_1_1Import.html +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - -The Red Matrix: RedMatrix\Import\Import Class Reference - - - - - - - - - - - - - -
-
- - - - - - - -
-
The Red Matrix -
-
-
- - - - - -
-
- -
-
-
- -
- - - - -
- -
- -
- -
-
RedMatrix\Import\Import Class Reference
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

 get_credentials ()
 
 get_itemlist ()
 
 get_item_ident ($item)
 
 get_item ($item_ident)
 
 get_taxonomy ($item_ident)
 
 get_children ($item_ident)
 
 convert_item ($item_ident)
 
 convert_taxonomy ($item_ident)
 
 convert_child ($child)
 
 store ($item, $update=false)
 
 run ()
 
- - - - - - - -

-Protected Attributes

 $itemlist = null
 
 $src_items = null
 
 $items = null
 
- - - -

-Private Attributes

 $credentials = null
 
-

Member Function Documentation

- -
-
- - - - - - - - -
RedMatrix\Import\Import::convert_child ( $child)
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - - -
RedMatrix\Import\Import::convert_item ( $item_ident)
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - - -
RedMatrix\Import\Import::convert_taxonomy ( $item_ident)
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - - -
RedMatrix\Import\Import::get_children ( $item_ident)
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - -
RedMatrix\Import\Import::get_credentials ()
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - - -
RedMatrix\Import\Import::get_item ( $item_ident)
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - - -
RedMatrix\Import\Import::get_item_ident ( $item)
-
- -
-
- -
-
- - - - - - - -
RedMatrix\Import\Import::get_itemlist ()
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - - -
RedMatrix\Import\Import::get_taxonomy ( $item_ident)
-
- -

Referenced by RedMatrix\Import\Import\run().

- -
-
- -
-
- - - - - - - -
RedMatrix\Import\Import::run ()
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
RedMatrix\Import\Import::store ( $item,
 $update = false 
)
-
- -
-
-

Member Data Documentation

- -
-
- - - - - -
- - - - -
RedMatrix\Import\Import::$credentials = null
-
-private
-
-
- -
-
- - - - - -
- - - - -
RedMatrix\Import\Import::$itemlist = null
-
-protected
-
-
- -
-
- - - - - -
- - - - -
RedMatrix\Import\Import::$items = null
-
-protected
-
- -
-
- -
-
- - - - - -
- - - - -
RedMatrix\Import\Import::$src_items = null
-
-protected
-
- -
-
-
The documentation for this class was generated from the following file: -
-
- diff --git a/doc/html/classRedmatrix_1_1Import_1_1Import.js b/doc/html/classRedmatrix_1_1Import_1_1Import.js deleted file mode 100644 index 6d01249e1..000000000 --- a/doc/html/classRedmatrix_1_1Import_1_1Import.js +++ /dev/null @@ -1,18 +0,0 @@ -var classRedMatrix_1_1Import_1_1Import = -[ - [ "convert_child", "classRedMatrix_1_1Import_1_1Import.html#a5434325afb2c633c52540127d717800a", null ], - [ "convert_item", "classRedMatrix_1_1Import_1_1Import.html#a107703a43a1b0ceb2af7ae470cb3f218", null ], - [ "convert_taxonomy", "classRedMatrix_1_1Import_1_1Import.html#addf6e53dacd971eaab49be4b17a767d6", null ], - [ "get_children", "classRedMatrix_1_1Import_1_1Import.html#a57561904b0f127e0d9a3e2c33688daf8", null ], - [ "get_credentials", "classRedMatrix_1_1Import_1_1Import.html#a24134929d9a8a682da2036a0bf326367", null ], - [ "get_item", "classRedMatrix_1_1Import_1_1Import.html#a27987a41cb703a796f1821baeb4774a2", null ], - [ "get_item_ident", "classRedMatrix_1_1Import_1_1Import.html#a772c28edf36aaf8e66007a95004c4059", null ], - [ "get_itemlist", "classRedMatrix_1_1Import_1_1Import.html#a855cd5a79b95d269ae8737fae774e3bc", null ], - [ "get_taxonomy", "classRedMatrix_1_1Import_1_1Import.html#ae3c6472bea1a44025bc2e152604eb20c", null ], - [ "run", "classRedMatrix_1_1Import_1_1Import.html#a8d138a9a7d4f79b81d3446ca216a602c", null ], - [ "store", "classRedMatrix_1_1Import_1_1Import.html#a33ed595de044c0ec1cd84cca719e31dc", null ], - [ "$credentials", "classRedMatrix_1_1Import_1_1Import.html#a864aac9fadb4846f5d9f840e8e0f440f", null ], - [ "$itemlist", "classRedMatrix_1_1Import_1_1Import.html#ad0d2bdc3b388220479063915b4f5c2fc", null ], - [ "$items", "classRedMatrix_1_1Import_1_1Import.html#a0a05dac405ccc5b617b7b7b3c8ed783c", null ], - [ "$src_items", "classRedMatrix_1_1Import_1_1Import.html#a88c2eeba8d0cba3e7c12a2c45ba0fbc6", null ] -]; diff --git a/doc/html/namespaceRedmatrix_1_1Import.html b/doc/html/namespaceRedmatrix_1_1Import.html deleted file mode 100644 index a0ab85227..000000000 --- a/doc/html/namespaceRedmatrix_1_1Import.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - -The Red Matrix: RedMatrix\Import Namespace Reference - - - - - - - - - - - - - -
-
- - - - - - - -
-
The Red Matrix -
-
-
- - - - - -
-
- -
-
-
- -
- - - - -
- -
- -
- -
-
RedMatrix\Import Namespace Reference
-
-
- - - - -

-Classes

class  Import
 
-
-
- diff --git a/doc/html/namespaceRedmatrix_1_1Import.js b/doc/html/namespaceRedmatrix_1_1Import.js deleted file mode 100644 index c26a05140..000000000 --- a/doc/html/namespaceRedmatrix_1_1Import.js +++ /dev/null @@ -1,4 +0,0 @@ -var namespaceRedMatrix_1_1Import = -[ - [ "Import", "classRedMatrix_1_1Import_1_1Import.html", "classRedMatrix_1_1Import_1_1Import" ] -]; \ No newline at end of file diff --git a/include/network.php b/include/network.php index 170b77d7d..224d9d5e1 100644 --- a/include/network.php +++ b/include/network.php @@ -464,24 +464,47 @@ function allowed_email($email) { return false; $str_allowed = get_config('system','allowed_email'); - if(! $str_allowed) + $str_not_allowed = get_config('system','not_allowed_email'); + + if(! $str_allowed && ! $str_not_allowed) return true; - $found = false; - + $return = false; + $found_allowed = false; + $found_not_allowed = false; + $fnmatch = function_exists('fnmatch'); + $allowed = explode(',',$str_allowed); if(count($allowed)) { foreach($allowed as $a) { $pat = strtolower(trim($a)); - if(($fnmatch && fnmatch($pat,$domain)) || ($pat == $domain)) { - $found = true; + if(($fnmatch && fnmatch($pat,$email)) || ($pat == $domain)) { + $found_allowed = true; break; } } } - return $found; + + $not_allowed = explode(',',$str_not_allowed); + + if(count($not_allowed)) { + foreach($not_allowed as $na) { + $pat = strtolower(trim($na)); + if(($fnmatch && fnmatch($pat,$email)) || ($pat == $domain)) { + $found_not_allowed = true; + break; + } + } + } + + if ($found_allowed) { + $return = true; + } elseif (!$str_allowed && !$found_not_allowed) { + $return = true; + } + return $return; } -- cgit v1.2.3 From 2e783dbe79be9db8f88dde092daa33592c1e3672 Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Sun, 25 Jan 2015 02:08:59 -0200 Subject: Call sslify with an extra path element so files keep their names The main motivation for this is when saving images one doesn't need to inspect and manually input the file's actual name. There might be other benefits, perhaps in automated downloads. --- include/text.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index b6e4abf24..47694a17c 100644 --- a/include/text.php +++ b/include/text.php @@ -898,7 +898,8 @@ function sslify($s) { $cnt = preg_match_all("/\<(.*?)src=\"(http\:.*?)\"(.*?)\>/",$s,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $match) { - $s = str_replace($match[2],z_root() . '/sslify?f=&url=' . urlencode($match[2]),$s); + $filename = basename( parse_url($match[2],PHP_URL_PATH) ); + $s = str_replace($match[2],z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($match[2]),$s); } } return $s; -- cgit v1.2.3