svn: /web/doc-editor/trunk/php/ AccountManager.php RepositoryManager.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Thu, 25 Mar 2010 22:22:51 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=296824

Log:
Fix date check for the setStaticValue method

Changed paths:
    U   web/doc-editor/trunk/php/AccountManager.php
    U   web/doc-editor/trunk/php/RepositoryManager.php

Modified: web/doc-editor/trunk/php/AccountManager.php
===================================================================
--- web/doc-editor/trunk/php/AccountManager.php	2010-03-25 20:48:16 UTC (rev 296823)
+++ web/doc-editor/trunk/php/AccountManager.php	2010-03-25 22:22:51 UTC (rev 296824)
@@ -248,7 +248,7 @@

               // We construct the return's var for ExtJs
               $return['state'] = true;
-
+
            }
         } elseif ($AuthReturn == 'Bad password') {


Modified: web/doc-editor/trunk/php/RepositoryManager.php
===================================================================
--- web/doc-editor/trunk/php/RepositoryManager.php	2010-03-25 20:48:16 UTC (rev 296823)
+++ web/doc-editor/trunk/php/RepositoryManager.php	2010-03-25 22:22:51 UTC (rev 296824)
@@ -1305,17 +1305,16 @@
         $s = "SELECT id FROM staticValue WHERE
               `project` = '".$project."' AND
               `type`    = '".$type."' AND
-              `field`   = '".$field."' AND
-              `date`    = now()
+              `field`   = '".$field."'
              ";
         $r = $db->query($s);

         if( $r->num_rows == 0 ) {
-            $s = "INSERT INTO staticValue (`project`, `type`, `field`, `value`) VALUES ('".$project."' , '".$type."' , '".$field."', '".$db->real_escape_string($value)."')";
+            $s = "INSERT INTO staticValue (`project`, `type`, `field`, `value`, `date`) VALUES ('".$project."' , '".$type."' , '".$field."', '".$db->real_escape_string($value)."', now())";
             $db->query($s);
         } else {
             $a = $r->fetch_object();
-            $s = "UPDATE staticValue SET `value`= '".$db->real_escape_string($value)."' WHERE `id`='".$a->id."'";
+            $s = "UPDATE staticValue SET `value`= '".$db->real_escape_string($value)."', `date`=now() WHERE `id`='".$a->id."'";
             $db->query($s);
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.