Re-merge changes from a2hosting dev
authorDan
Sat, 12 Dec 2009 15:44:36 -0500
changeset 1160 c0e0a1787a63
parent 1157 e154e8176700 (diff)
parent 1159 a1cca4472a58 (current diff)
child 1161 9c0c519066ac
Re-merge changes from a2hosting dev
includes/sessions.php
--- a/includes/paths.php	Sat Dec 12 15:43:23 2009 -0500
+++ b/includes/paths.php	Sat Dec 12 15:44:36 2009 -0500
@@ -80,9 +80,9 @@
     $session->register_acl_type('mod_misc',               AUTH_DISALLOW, 'perm_mod_misc',               Array(),                                                  'All');
     $session->register_acl_type('edit_cat',               AUTH_WIKIMODE, 'perm_edit_cat',               Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
     $session->register_acl_type('even_when_protected',    AUTH_DISALLOW, 'perm_even_when_protected',    Array('edit_page', 'rename', 'mod_comments', 'edit_cat'), 'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('upload_files',           AUTH_DISALLOW, 'perm_upload_files',           Array('create_page'),                                     'Article|User|Project|Template|File|Help|System|Category|Special');
-    $session->register_acl_type('upload_new_version',     AUTH_WIKIMODE, 'perm_upload_new_version',     Array('upload_files'),                                    'Article|User|Project|Template|File|Help|System|Category|Special');
-    $session->register_acl_type('create_page',            AUTH_WIKIMODE, 'perm_create_page',            Array(),                                                  'Article|User|Project|Template|File|Help|System|Category|Special');
+    $session->register_acl_type('create_page',            AUTH_WIKIMODE, 'perm_create_page',            Array(),                                                  'All');
+    $session->register_acl_type('upload_files',           AUTH_DISALLOW, 'perm_upload_files',           Array('create_page'),                                     'All');
+    $session->register_acl_type('upload_new_version',     AUTH_WIKIMODE, 'perm_upload_new_version',     Array('upload_files'),                                    'All');
     $session->register_acl_type('html_in_pages',          AUTH_DISALLOW, 'perm_html_in_pages',          Array('edit_page'),                                       'Article|User|Project|Template|File|Help|System|Category|Admin');
     $session->register_acl_type('php_in_pages',           AUTH_DISALLOW, 'perm_php_in_pages',           Array('edit_page', 'html_in_pages'),                      'Article|User|Project|Template|File|Help|System|Category|Admin');
     $session->register_acl_type('custom_user_title',      AUTH_DISALLOW, 'perm_custom_user_title',      Array(),                                                  'User|Special');
--- a/includes/render.php	Sat Dec 12 15:43:23 2009 -0500
+++ b/includes/render.php	Sat Dec 12 15:44:36 2009 -0500
@@ -929,8 +929,8 @@
       eval($cmd);
     }
     
-    $can_do_php = ( $session->get_permissions('php_in_pages') && !$strip_all_php );
-    $can_do_html = $session->get_permissions('html_in_pages');
+    $can_do_php = ( !$strip_all_php && $session->get_permissions('php_in_pages') );
+    $can_do_html = $session->check_acl_scope('html_in_pages', $paths->namespace) && $session->get_permissions('html_in_pages');
     
     if ( $can_do_html && !$can_do_php )
     {
--- a/includes/sessions.php	Sat Dec 12 15:43:23 2009 -0500
+++ b/includes/sessions.php	Sat Dec 12 15:44:36 2009 -0500
@@ -3372,6 +3372,7 @@
         if ( !$this->check_acl_scope($deps[$i], $paths->namespace) )
         {
           // Action $type depends on action $deps[$i] which cannot be satisfied because $deps[$i] is out of scope.
+          // echo '<pre>' . enano_debug_print_backtrace(true) . '</pre>';
           trigger_error("acl_check_deps: $type depends on {$deps[$i]} which is not within scope of $paths->namespace; this indicats a bug in ACL rule specification", E_USER_WARNING);
           return false;
         }
--- a/includes/wikiengine/parse_mediawiki.php	Sat Dec 12 15:43:23 2009 -0500
+++ b/includes/wikiengine/parse_mediawiki.php	Sat Dec 12 15:44:36 2009 -0500
@@ -19,6 +19,8 @@
     'underline' => '/__(.+?)__/',
     'externalwithtext' => '#\[((?:https?|irc|ftp)://.+?) (.+?)\]#',
     'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#',
+    'mailtonotext' => '#\[mailto:([^ \]]+?)\]#',
+    'mailtowithtext' => '#\[mailto:([^ \]]+?) (.+?)\]#',
     'hr' => '/^[-]{4,} *$/m'
   );
   
--- a/includes/wikiengine/render_xhtml.php	Sat Dec 12 15:43:23 2009 -0500
+++ b/includes/wikiengine/render_xhtml.php	Sat Dec 12 15:44:36 2009 -0500
@@ -144,6 +144,18 @@
     
     return $text;
   }
+  
+  public function mailtonotext($pieces)
+  {
+    $pieces[2] = $pieces[1];
+    return $this->mailtowithtext($pieces);
+  }
+  
+  public function mailtowithtext($pieces)
+  {
+    global $email;
+    return $email->encryptEmail($pieces[1], '', '', $pieces[2]);
+  }
 }
 
 // Alias internal link parsing to RenderMan's method
--- a/includes/wikiformat.php	Sat Dec 12 15:43:23 2009 -0500
+++ b/includes/wikiformat.php	Sat Dec 12 15:44:36 2009 -0500
@@ -70,6 +70,8 @@
       'underline',
       'externalwithtext',
       'externalnotext',
+      'mailtowithtext',
+      'mailtonotext',
       'image',
       'internallink',
       'paragraph',