[pLog-svn] r4357 - in plog/branches/lifetype-1.1.3/class: action/admin net/http

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Tue Nov 28 12:52:10 GMT 2006


Author: jondaley
Date: 2006-11-28 12:52:09 +0000 (Tue, 28 Nov 2006)
New Revision: 4357

Modified:
   plog/branches/lifetype-1.1.3/class/action/admin/adminupdateblogsettingsaction.class.php
   plog/branches/lifetype-1.1.3/class/net/http/subdomains.class.php
Log:
when custom domains are enabled, you can't ever update the blog settings, due to the duplicate name check sees its own name.  We can now ignore our blogId when searching for a valid domain name.  Might be related to: http://bugs.lifetype.net/view.php?id=1129

Modified: plog/branches/lifetype-1.1.3/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/branches/lifetype-1.1.3/class/action/admin/adminupdateblogsettingsaction.class.php	2006-11-27 21:50:47 UTC (rev 4356)
+++ plog/branches/lifetype-1.1.3/class/action/admin/adminupdateblogsettingsaction.class.php	2006-11-28 12:52:09 UTC (rev 4357)
@@ -89,7 +89,7 @@
 					$this->_form->setFieldValidationStatus( "blogSubDomain", false );					
 					$this->validationErrorProcessing();					
                 }
-				if( Subdomains::domainNameExists( $this->blogDomain )) {
+				if( Subdomains::domainNameExists( $this->blogDomain, $this->_blogInfo->getId() )) {
 					$valid = false;
 					$this->_form->setFieldValidationStatus( "blogSubDomain", false );					
 					$this->validationErrorProcessing();					
@@ -141,7 +141,6 @@
                 if(!$mainDomain)
 					$mainDomain = "?";
                 $subDomain = Textfilter::domainize($this->_request->getValue( "blogSubDomain" ));
-
                 if( !Subdomains::isDomainAvailable( $mainDomain )) {
                     $this->_view = new AdminBlogSettingsView( $this->_blogInfo );
                     $this->_view->setErrorMessage( $this->_locale->tr("error_updating_blog_domain"));

Modified: plog/branches/lifetype-1.1.3/class/net/http/subdomains.class.php
===================================================================
--- plog/branches/lifetype-1.1.3/class/net/http/subdomains.class.php	2006-11-27 21:50:47 UTC (rev 4356)
+++ plog/branches/lifetype-1.1.3/class/net/http/subdomains.class.php	2006-11-28 12:52:09 UTC (rev 4357)
@@ -137,12 +137,15 @@
 		 * @param domain
 		 * @return true if successful and false otherwise
 		 */
-		function domainNameExists( $domain )
+		function domainNameExists( $domain, $ignoreBlogId=0 )
 		{
 			include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 			$blogs = new Blogs();
-			$valid = is_object( $blogs->getBlogInfoByDomain( $domain )); 		
-			
+            $blog = $blogs->getBlogInfoByDomain( $domain );
+			$valid = is_object($blog);
+			if($valid && $ignoreBlogId != 0){
+                return ($blog->getId() != $ignoreBlogId);
+            }
 			return( $valid );
 		}
 	}



More information about the pLog-svn mailing list