[pLog-svn] r4539 - in plugins/trunk/unported/atom: . class/action class/view class/xml class/xml/atom templates

oscar at devel.lifetype.net oscar at devel.lifetype.net
Thu Jan 11 23:03:46 GMT 2007


Author: oscar
Date: 2007-01-11 23:03:46 +0000 (Thu, 11 Jan 2007)
New Revision: 4539

Modified:
   plugins/trunk/unported/atom/class/action/adminatompluginsettingsaction.class.php
   plugins/trunk/unported/atom/class/action/adminatompluginupdatesettingsaction.class.php
   plugins/trunk/unported/atom/class/view/adminatompluginsettingsview.class.php
   plugins/trunk/unported/atom/class/xml/atom/atomDom.php
   plugins/trunk/unported/atom/class/xml/atom/atomrequest.class.php
   plugins/trunk/unported/atom/class/xml/atom/atomserver.class.php
   plugins/trunk/unported/atom/class/xml/atom/editservice.class.php
   plugins/trunk/unported/atom/class/xml/atom/plogatomabstractservice.class.php
   plugins/trunk/unported/atom/class/xml/atom/postservice.class.php
   plugins/trunk/unported/atom/class/xml/atom/wsseauthentication.class.php
   plugins/trunk/unported/atom/class/xml/lib.xml.inc.php
   plugins/trunk/unported/atom/pluginatom.class.php
   plugins/trunk/unported/atom/templates/pluginsettings.template
Log:
clean up and port of the 'atom' plugin so that it works with LT 1.2. I've also implemented permission for most of the atom services (posting new articles, updating, deleting) as well as removed plenty of notices and warnings. Posting images hasn't been tested because my version of ecto doesn't support attachments when using atom so it'll have to wait until I can test this with a phone.


Modified: plugins/trunk/unported/atom/class/action/adminatompluginsettingsaction.class.php
===================================================================
--- plugins/trunk/unported/atom/class/action/adminatompluginsettingsaction.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/action/adminatompluginsettingsaction.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -11,6 +11,8 @@
 		function AdminAtomPluginSettingsAction( $actionInfo, $request )
 		{
 			$this->AdminAction( $actionInfo, $request );
+			
+			$this->requirePermission( "manage_plugins" );			
 		}
 
 		function perform()

Modified: plugins/trunk/unported/atom/class/action/adminatompluginupdatesettingsaction.class.php
===================================================================
--- plugins/trunk/unported/atom/class/action/adminatompluginupdatesettingsaction.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/action/adminatompluginupdatesettingsaction.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -17,6 +17,8 @@
 		function AdminAtomPluginUpdateSettingsAction( $actionInfo, $request )
 		{
 			$this->AdminAction( $actionInfo, $request );
+			
+			$this->requirePermission( "manage_plugins" );
 		}
 	
 		function validate()
@@ -27,7 +29,7 @@
 			// check how images should be embedded
 			$this->_previewType = $this->_request->getValue( "resourcePreviewType" );
 			if( $this->_previewType < ATOM_EMBED_SMALL_PREVIEW ||
-			    $this->_previewType > ATOM_EMBED_FULL_SIZE )
+			    $this->_previewType > ATOM_EMBED_FULL_SIZE_VIEW )
 			    $this->_previewType = ATOM_EMBED_SMALL_PREVIEW;
 			
 			$this->_loggingEnabled = $this->_request->getValue( "loggingEnabled" );

Modified: plugins/trunk/unported/atom/class/view/adminatompluginsettingsview.class.php
===================================================================
--- plugins/trunk/unported/atom/class/view/adminatompluginsettingsview.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/view/adminatompluginsettingsview.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -43,7 +43,11 @@
 			     $config =& Config::getConfig();
 			     $loggingEnabled = $config->getValue( "atom_logging_enabled" );
 			     $dontSetHeaders = $config->getValue( "atom_dont_set_headers" );
-			}							
+			}
+			else {
+				$loggingEnabled = false;
+				$dontSetHeaders = false;
+			}
 			
 			// finally pass all these things to the templates
 			$this->setValue( "atomPassword", $atomPassword );

Modified: plugins/trunk/unported/atom/class/xml/atom/atomDom.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/atomDom.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/atomDom.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -90,7 +90,7 @@
 			switch($item->nodeName) {
 				case $atomNS . "title":
 					$title=createRichText($item);
-					AtomLogger::Log( "* * title: " . $title );
+					//AtomLogger::Log( "* * title: " . $title );
 					$atom->title=$title;
 					break;
 				case $atomNS . "summary":
@@ -207,11 +207,11 @@
 	AtomLogger::Log("* * name: " . $name);
 	$generator->generator = $name;
 
-	$version = $gen->attributes["version"];
+	isset( $gen->attributes["version"] ) ? $version = $gen->attributes["version"] : $version = "";
 	AtomLogger::Log("* * @version: " . $version);
 	$generator->version = $version;	
 
-	$url = $gen->attributes["url"];
+	isset( $gen->attributes["url"] ) ? $url = $gen->attributes["url"] : $url = "";
 	AtomLogger::Log("* * @url: " . $url);
 	$generator->url = $url;	
 

Modified: plugins/trunk/unported/atom/class/xml/atom/atomrequest.class.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/atomrequest.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/atomrequest.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -1,6 +1,5 @@
 <?php
 
-	
 	lt_include( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
 	lt_include( PLOG_CLASS_PATH."plugins/atom/class/xml/lib.xml.inc.php" );
 	lt_include( PLOG_CLASS_PATH."plugins/atom/class/xml/atom/atomFunc.php" );
@@ -229,22 +228,24 @@
 		{
 			// retrieve the PATH_INFO 
 			$server = HttpVars::getServer();
-			$path = $server["PATH_INFO"];
+			isset( $server["PATH_INFO"] ) ? $path = $server["PATH_INFO"] : $path = "";
 			
 			// do some clean up here before we split the parts
-			if( $path[0] == "/" ) 
-			     $path = substr( $path, 1, strlen($path));
+			if( isset( $path[0] )) {
+				if( $path[0] == "/" ) 
+				     $path = substr( $path, 1, strlen($path));
+			}
 			
 			// split the path in its parts
 			$parts = explode( "/", $path );
 			
 			
 			// the service is always the first part...
-			$this->_service = $parts[0];
+			isset( $parts[0] ) ? $this->_service = $parts[0] : $this->_service = "";
 			// the blog id is the second
-			$this->_blogId = $parts[1];
+			isset( $parts[1] ) ? $this->_blogId = $parts[1] : $this->_blogId = "";
 			// and the post id, if any, is the third
-			$this->_articleId = $parts[2];
+			isset( $parts[2] ) ? $this->_articleId = $parts[2] : $this->_articleId = "";
 			
 			AtomLogger::Log( "-- Incoming request: $path" );
 			AtomLogger::Log( "   Service: ".$this->_service );

Modified: plugins/trunk/unported/atom/class/xml/atom/atomserver.class.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/atomserver.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/atomserver.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -15,12 +15,6 @@
 	/**
 	 * Array with all the services implemented so far
 	 */
-	$atomServices = Array( "default"    => "DefaultService",
-	                       "feed"       => "FeedService",
-	                       "edit"       => "EditService",	
-	                       "categories" => "CategoriesService",
-	                       "post" 	    => "PostService" );
-
 	/**
 	 * class that handles all the atom requests
 	 */
@@ -32,8 +26,6 @@
 
 		function AtomServer()
 		{
-			
-			
 			$this->_response = null;
 			$this->_request  = null;
 		}
@@ -46,7 +38,11 @@
 		function processRequest( $request = null )
 		{
 			// array with all the services implemented so far
-			global $atomServices;
+			$atomServices = Array( "default"    => "DefaultService",
+			                       "feed"       => "FeedService",
+			                       "edit"       => "EditService",	
+			                       "categories" => "CategoriesService",
+			                       "post" 	    => "PostService" );
 
 			// check if the request authenticated ok
 			if( !$request->isAuthenticated()) {

Modified: plugins/trunk/unported/atom/class/xml/atom/editservice.class.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/editservice.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/editservice.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -57,27 +57,35 @@
 		 */
 		function doDelete()
 		{
-		      // get the article id
-		      $articleId = $this->_request->getArticleId();
-		      AtomLogger::Log( "Removing article with id $articleId" );
-		      
-		      $articles = new Articles();
-		      if( !$articles->deleteArticle( $articleId, $this->_userInfo->getId(), $this->_blogInfo->getId())) {
-		          AtomLogger::Log( "There was an error removing the article" );
-		          $response = new AtomErrorResponse( "Error removing article with identifier $articleId",
-		                                             HTTP_ERROR_500 );
-		          $this->setResponse( $response );
-		          return false;
-		      }
-		      
-		      // a response only needs an HTTP 200 OK to acknowledge that the post was removed successfully
-		      AtomLogger::Log( "Article removed successfully" );
-		      $response = new AtomResponse( "Article deleted OK", Array( HTTP_OK_200 ));
-		      $this->setResponse( $response );
-			  
-			  CacheControl::resetBlogCache( $this->_blogInfo->getId());
-		      
-		      return true;
+			// check if the user has posting permissions
+			if( !$this->userHasPermission( "update_post" )) {
+				AtomLogger::Log( "User does not have update_post permission" );
+				$response = new AtomErrorResponse( "You do not have enough permissions to perform this operation", HTTP_ERROR_500 );
+				$this->setResponse( $response );		       
+				return false;				
+			}			
+
+			// get the article id
+			$articleId = $this->_request->getArticleId();
+			AtomLogger::Log( "Removing article with id $articleId" );
+
+			$articles = new Articles();
+			if( !$articles->deleteArticle( $articleId, $this->_userInfo->getId(), $this->_blogInfo->getId())) {
+				AtomLogger::Log( "There was an error removing the article" );
+				$response = new AtomErrorResponse( "Error removing article with identifier $articleId",
+				HTTP_ERROR_500 );
+				$this->setResponse( $response );
+				return false;
+			}
+
+			// a response only needs an HTTP 200 OK to acknowledge that the post was removed successfully
+			AtomLogger::Log( "Article removed successfully" );
+			$response = new AtomResponse( "Article deleted OK", Array( HTTP_OK_200 ));
+			$this->setResponse( $response );
+
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+
+			return true;
 		}
 		
 		/**
@@ -85,6 +93,14 @@
 		 */
 		function doPut()
 		{
+			// check if the user has posting permissions
+			if( !$this->userHasPermission( "update_post" )) {
+				AtomLogger::Log( "User does not have update_post permission" );
+				$response = new AtomErrorResponse( "You do not have enough permissions to perform this operation", HTTP_ERROR_500 );
+				$this->setResponse( $response );		       
+				return false;				
+			}			
+			
 			$articleId = $this->_request->getArticleId();
 			$blogId = $this->_blogInfo->getId();			
 			AtomLogger::Log( "Attempting to update article $articleId in blog $blogId" );

Modified: plugins/trunk/unported/atom/class/xml/atom/plogatomabstractservice.class.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/plogatomabstractservice.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/plogatomabstractservice.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -4,6 +4,11 @@
 	lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 	
+	if( !defined( "ADMIN_PERMISSION" )) 
+		define( "ADMIN_PERMISSION", 1 );
+	if( !defined( "BLOG_PERMISSION" )) 
+		define( "BLOG_PERMISSION", 2 );	
+	
 	/**
 	 * plog-dependent class that starts messing around with blogs and users. So far the layer
 	 * was pretty generic but at some point we have to get into plog... and it is here :)
@@ -79,6 +84,34 @@
 		function getUserInfo()
 		{
 			return $this->_userInfo;
-		}	
+		}
+		
+		/**
+		 * Extra helper method to check permissions
+		 *
+		 * @param user A UserInfo object
+		 * @param blog A BlogInfo object
+		 * @param permName Name of the permission
+		 * @param mode Either BLOG_PERMISSION or ADMIN_PERMISSION, depending on whether
+		 * we're checking the user's permissions in this blog or an admin permission
+		 */
+		function userHasPermission( $permName, $mode = BLOG_PERMISSION )
+		{			
+			// check for the permission, whether the user is the blog owner or
+			// whether the user is a site administrator
+			$hasPermission = false;
+			if( $mode == BLOG_PERMISSION ) {
+		    	$hasPermission = ( 
+		    		$this->_userInfo->hasPermissionByName( $permName, $this->_blogInfo->getId()) ||
+		    		$this->_blogInfo->getOwnerId() == $this->_userInfo->getId() ||
+					$this->_userInfo->hasPermissionByName( "edit_blog_admin_mode", 0 )
+		    	);
+			}
+			else {				
+		    	$hasPermission = ( $this->_userInfo->hasPermissionByName( $permName, 0 ));
+			}
+		
+			return( $hasPermission );
+		}		
 	}
 ?>
\ No newline at end of file

Modified: plugins/trunk/unported/atom/class/xml/atom/postservice.class.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/postservice.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/postservice.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -80,6 +80,14 @@
 		 */
 		function doArticlePost()
 		{
+			// check if the user has posting permissions
+			if( !$this->userHasPermission( "add_post" )) {
+		          AtomLogger::Log( "User does not have add_post permission" );
+		          $response = new AtomErrorResponse( "You do not have enough permissions to perform this operation", HTTP_ERROR_500 );
+		          $this->setResponse( $response );		       
+		          return false;				
+			}
+			
 		    // get the atom document and its contents so that we can fill in the gaps
 		    // in the Article object
 		    AtomLogger::Log( "POSTing an article to the site!" );
@@ -200,6 +208,8 @@
             }
                 
             $resources = new GalleryResources();                
+
+			$result = "";
                 
             // otherwise, go through them...
             foreach( $links as $link ) {
@@ -253,89 +263,97 @@
 		 */  
 		function doBinaryObjectPost()
 		{
-		      // first of all, get the contents and save them to a file
-		      $document = $this->_request->getAtomDocument();
-		      $contents = $document->content;
-		      $content = $contents[0];
-		      
-		      // we figure out the extension based on their mime type
-		      $mimeTypes = new MimeType();
-              $fileMimeType = $content->type;
-              $fileExtension = $mimeTypes->getExtension( $fileMimeType );
-              AtomLogger::Log( "doBinaryObjectPost: mime type = $fileMimeType" );
-              AtomLogger::Log( "doBinaryObjectPost: file extension = $fileExtension " );
-              
-              // also, come up with a name based on the contents of the <summary>...</summary> tags, which
-              // are unfortunately not mandatory. If there is no summary (for instance Nokia's lifeblog uses
-              // the summary to send the 'caption' of the picture in the app), then we come up with an
-              // extremely random name
-              $summary = $document->title->text;
-              if( $summary == "" ) {
-                $fileName = md5(microtime()).".$fileExtension";
-              }
-              else {
-                // get the name of the file from whatever the client sent
-                $fileName = $summary;
-                // and then, make sure it doesn't have any strange characters in it...
-                $tf = new Textfilter();
-                $fileName = $tf->urlize( $fileName ).".$fileExtension";
-              }
-                
-              AtomLogger::Log( "doBinaryObjectPost: file name = ".$fileName );
-              
-              // next step is to save the file in some temporary place
-              $config =& Config::getConfig();
-              $tempFolder = $config->getTempFolder();
-              $filePath = $tempFolder."/".$fileName;
-              AtomLogger::Log( "doBinaryPostObject: saving data to $filePath" );
-              $file = new File( $filePath );
-              if( !$file->open( "w+" )) {
-                    // if we had an error trying to save the file, then we quit...
-                    $response = new AtomErrorResponse( "Error creating temporary file for binary post", HTTP_ERROR_500 );
-                    $this->setResponse( $response );
-                    
-                    return false;
-              } 
-              // but if everything went fine, then we go ahead and save the file
-              if( !$file->write( $content->text )) {
-                    // if we had an error trying to save the file, then we quit...
-                    $response = new AtomErrorResponse( "Error saving data to temporary file", HTTP_ERROR_500 );
-                    $this->setResponse( $response );
-                    
-                    return false;
-              }
-              
-              //
-              // now that the file has been saved somewhere in disk and we know where it is, 
-              // we can add it to the gallery
-              //
-              $resources = new GalleryResources();
-              // find the right album id
-              $albumId = $this->checkMoblogAlbum();
-              $resourceId = $resources->addResourceFromDisk( $this->_blogInfo->getId(), $albumId, $summary, $filePath );
-            
-              if( !$resourceId ) {
-                    AtomLogger::Log( "There was an error saving the resource. Error code = $resourceId" );
-                    $response = new AtomErrorResponse( "Error saving resource", HTTP_ERROR_500 );
-                    $this->setResponse( $response );
-                    
-                    return false;
-              }
+			// check if the user has posting permissions
+			if( !$this->userHasPermission( "add_resource" )) {
+				AtomLogger::Log( "User does not have add_resource permission" );
+				$response = new AtomErrorResponse( "You do not have enough permissions to perform this operation", HTTP_ERROR_500 );
+				$this->setResponse( $response );		       
+				return false;				
+			}			
 
-            AtomLogger::Log( "Resource was saved with resource id = $resourceId" );
-		    $newResource = $resources->getResource( $resourceId );
-		    if( !$newResource ) {
-                    AtomLogger::Log( "There was an error loading the new resource" );
-                    $response = new AtomErrorResponse( "Error loading resource", HTTP_ERROR_500 );
-                    $this->setResponse( $response );
-                    return false;		    
-		    }
+			// first of all, get the contents and save them to a file
+			$document = $this->_request->getAtomDocument();
+			$contents = $document->content;
+			$content = $contents[0];
+
+			// we figure out the extension based on their mime type
+			$mimeTypes = new MimeType();
+			$fileMimeType = $content->type;
+			$fileExtension = $mimeTypes->getExtension( $fileMimeType );
+			AtomLogger::Log( "doBinaryObjectPost: mime type = $fileMimeType" );
+			AtomLogger::Log( "doBinaryObjectPost: file extension = $fileExtension " );
+
+			// also, come up with a name based on the contents of the <summary>...</summary> tags, which
+			// are unfortunately not mandatory. If there is no summary (for instance Nokia's lifeblog uses
+			// the summary to send the 'caption' of the picture in the app), then we come up with an
+			// extremely random name
+			$summary = $document->title->text;
+			if( $summary == "" ) {
+				$fileName = md5(microtime()).".$fileExtension";
+			}
+			else {
+				// get the name of the file from whatever the client sent
+				$fileName = $summary;
+				// and then, make sure it doesn't have any strange characters in it...
+				$tf = new Textfilter();
+				$fileName = $tf->urlize( $fileName ).".$fileExtension";
+			}
+
+			AtomLogger::Log( "doBinaryObjectPost: file name = ".$fileName );
+
+			// next step is to save the file in some temporary place
+			$config =& Config::getConfig();
+			$tempFolder = $config->getTempFolder();
+			$filePath = $tempFolder."/".$fileName;
+			AtomLogger::Log( "doBinaryPostObject: saving data to $filePath" );
+			$file = new File( $filePath );
+			if( !$file->open( "w+" )) {
+				// if we had an error trying to save the file, then we quit...
+				$response = new AtomErrorResponse( "Error creating temporary file for binary post", HTTP_ERROR_500 );
+				$this->setResponse( $response );
+
+				return false;
+			} 
+			// but if everything went fine, then we go ahead and save the file
+			if( !$file->write( $content->text )) {
+				// if we had an error trying to save the file, then we quit...
+				$response = new AtomErrorResponse( "Error saving data to temporary file", HTTP_ERROR_500 );
+				$this->setResponse( $response );
+
+				return false;
+			}
+
+			//
+			// now that the file has been saved somewhere in disk and we know where it is, 
+			// we can add it to the gallery
+			//
+			$resources = new GalleryResources();
+			// find the right album id
+			$albumId = $this->checkMoblogAlbum();
+			$resourceId = $resources->addResourceFromDisk( $this->_blogInfo->getId(), $albumId, $summary, $filePath );
+
+			if( !$resourceId ) {
+				AtomLogger::Log( "There was an error saving the resource. Error code = $resourceId" );
+				$response = new AtomErrorResponse( "Error saving resource", HTTP_ERROR_500 );
+				$this->setResponse( $response );
+
+				return false;
+			}
+
+			AtomLogger::Log( "Resource was saved with resource id = $resourceId" );
+			$newResource = $resources->getResource( $resourceId );
+			if( !$newResource ) {
+				AtomLogger::Log( "There was an error loading the new resource" );
+				$response = new AtomErrorResponse( "Error loading resource", HTTP_ERROR_500 );
+				$this->setResponse( $response );
+				return false;		    
+			}
 			$output = new AtomOutputRenderer( "resource" );
 			$output->setValue( "blog", $this->_blogInfo );
 			$output->setValue( "user", $this->_userInfo );
 			$output->setValue( "url", new AtomRequestGenerator( $this->getBlogInfo()));
 			$output->setValue( "resource", $newResource );
-			
+
 			// set the response
 			$response = new AtomResponse( $output->fetch(), Array( HTTP_OK_200 ));
 			$this->setResponse( $response );

Modified: plugins/trunk/unported/atom/class/xml/atom/wsseauthentication.class.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/atom/wsseauthentication.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/atom/wsseauthentication.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -85,12 +85,12 @@
 			     // the header could be X-WSSE, or X-Wsse or whatever so let's convert them all
 			     // to uppercase
 			     $headers = array_change_key_case( $headers, CASE_UPPER );			
-			     $wsseHeader = $headers["X-WSSE"];
+				 isset( $headers["X-WSSE"] ) ? $wsseHeader = $headers["X-WSSE"] : $wsseHeader = "";
 			 }
 			 else {
 			     // the method above is better but we can still try to use another one, maybe it will
 			     // work better!
-			     $wsseHeader = stripslashes($_SERVER["HTTP_X_WSSE"]);
+				 isset( $_SERVER["HTTP_X_WSSE"] ) ? $wsseHeader = stripslashes( $_SERVER["HTTP_X_WSSE"] ) : $wsseHeader = "";
 			 }
 
 			AtomLogger::Log( $wsseHeader );
@@ -106,19 +106,19 @@
 		{
             $regexp = '/Username="?([^"]+)"?(,|$)/';
             preg_match( $regexp, $header, $matches ); 
-            $this->userName = $matches[1];
+            isset( $matches[1] ) ? $this->userName = $matches[1] : $this->userName = "";
             
             $regexp = '/PasswordDigest="?([^"]+)"?(,|$)/';
             preg_match( $regexp, $header, $matches ); 
-            $this->passwordDigest = $matches[1];
+            isset( $matches[1] ) ? $this->passwordDigest = $matches[1] : $this->passwordDigest = "";
             
             $regexp = '/Nonce="?([^"]+)"?(,|$)/';
             preg_match( $regexp, $header, $matches ); 
-            $this->nonce = $matches[1];
+            isset( $matches[1] ) ? $this->nonce = $matches[1] : $this->nonce = "";
             
             $regexp = '/Created="?([^"]+)"?(,|$)/';
             preg_match( $regexp, $header, $matches ); 
-            $this->created = $matches[1]; 
+            isset( $matches[1] ) ? $this->created = $matches[1] : $this->created = "";
         }
 		
 		

Modified: plugins/trunk/unported/atom/class/xml/lib.xml.inc.php
===================================================================
--- plugins/trunk/unported/atom/class/xml/lib.xml.inc.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/class/xml/lib.xml.inc.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -25,6 +25,8 @@
 
 		// Property (r); retrieves the type of the requested node. 
 		var $nodeType;
+		
+		var $nextSibling;
 
 		function XMLText() {
 

Modified: plugins/trunk/unported/atom/pluginatom.class.php
===================================================================
--- plugins/trunk/unported/atom/pluginatom.class.php	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/pluginatom.class.php	2007-01-11 23:03:46 UTC (rev 4539)
@@ -34,10 +34,8 @@
 			$this->addMenuEntry( "/menu/controlCenter/manageSettings",   // menu path
                                              "atomSettings",    // menu id
                                              "admin.php?op=atomSettings",     // url
-                                             "Atom",    // text to show
-                                             true,       // can't...
-                                             false       // ...remember :)
-                                            );
+                                             "Atom"    // text to show
+                               );
 		}
 
 

Modified: plugins/trunk/unported/atom/templates/pluginsettings.template
===================================================================
--- plugins/trunk/unported/atom/templates/pluginsettings.template	2007-01-11 21:49:37 UTC (rev 4538)
+++ plugins/trunk/unported/atom/templates/pluginsettings.template	2007-01-11 23:03:46 UTC (rev 4539)
@@ -34,7 +34,6 @@
     </select>
  </div>
  
- 
  <!-- password -->
  <div class="field">
   <label for="password">{$locale->tr("password")}</label>



More information about the pLog-svn mailing list