Revision [13433]

This is an old revision of BrianKoontz made by BrianKoontz on 2006-03-11 01:47:17.

 

Why I'm here


I'm the coordinator for the Computer Science and Open Source Technology (OST) programs at North Lake College in Irving, TX. I've worked my way through several versions of the Wakka->Wacko->Wikka progeny line. Wakka dead-ended on me, while my Russian never did get any better with Wacko (no, I don't speak Russian, which made it very difficult to work with Wacko beyond the level of an end user). I'm currently using Wikka to host the course notes and other miscellaneous items for the OST program. I would like to see, at some point down the road, a merger of the best of features in both Wacko and Wikka...I believe both have their strong points, and it would be such a waste to see features in one lost on the other.

Wikka stuff


Stuff I've written

Stuff others have written that I've found useful

Stuff I'd like to implement if/when I get the time

Contact info

Brian Koontz
North Lake College
Irving, TX
brian@pongonova.net brian@pongonova.net


Misc. Code (see above for descriptions)


Clone ACLs Patch

--- clone.php	2006/03/11 05:26:01	1.1
+++ clone.php	2006/03/11 06:03:04
@@ -29,6 +29,8 @@
  * 
  * @input             boolean $editoption optional: if true, the new page will be opened for edition on creation
  *                            default is false (to allow multiple cloning of the same source)
+ * @input             boolean $cloneaclsoption optional: if true, ACLs will be copied from the source page to the new page
+ *                            default is false
  *
  * @todo              Use central library for valid pagenames.
  *        
@@ -39,6 +41,7 @@
 $to = $this->tag;
 $note = 'Cloned from '.$from; #i18n
 $editoption = ''; 
+$cloneaclsoption = '';
 $box = 'Please fill in a valid target ""PageName"" and an (optional) edit note.'; #i18n
 
 // print header
@@ -65,6 +68,8 @@
 			$to = ($_POST['to'])? $_POST['to'] : $to;
 			$note = ($_POST['note'])? $_POST['note'] : $note;
 			$editoption = (isset($_POST['editoption']))? 'checked="checked"' : '';
+			$cloneaclsoption = (isset($_POST['cloneaclsoption']))? 'checked="checked"' : '';
+
 		
 			// 3. check target pagename validity
 			if (!preg_match("/^[A-Z]+[a-zfl]+[A-Z0-9][A-Za-z0-9fl]*$/s", $to)) 
@@ -90,6 +95,17 @@
 						$thepage=$this->LoadPage($from); # load the source page
 						if ($thepage) $pagecontent = $thepage['body']; # get its content
 						$this->SavePage($to, $pagecontent, $note); #create target page
+                        // Clone ACLs if requested
+                        if($cloneaclsoption == 'checked="checked"')
+                        {
+                            $read_acl = $this->LoadACL($from, "read", 0);
+                            $write_acl = $this->LoadACL($from, "write", 0);
+                            $comment_acl = $this->LoadACL($from, "comment", 0);
+                            $this->SaveACL($to, "read", $this->TrimACLs($read_acl["read_acl"]));
+                            $this->SaveACL($to, "write", $this->TrimACLs($write_acl["write_acl"]));
+                            $this->SaveACL($to, "comment", $this->TrimACLs($comment_acl["comment_acl"]));
+                        }
+                        // Open editor if requested
 						if ($editoption == 'checked="checked"')
 						{
 							// quick edit
@@ -118,6 +134,11 @@
 			'<td></td>'.
 			'<td>'.
 			'<input type="checkbox" name="editoption" '.$editoption.' /> Edit after creation '.
+            '<input type="checkbox" name="cloneaclsoption" '.$cloneaclsoption.' /> Clone ACLs '.
+            '</tr>'.
+            '<tr>'.
+            '<td></td>'.
+            '<td>'.
 			'<input type="submit" name="create" value="Clone" />'.
 			'</td>'.
 			'</tr>'.






CategoryUsers
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki
Page was generated in 0.0301 seconds