Merge branch 'master' of http://nubati.net/git/e-DoKo
[e-DoKo.git] / include / db.php
index 208334f7772b93049dc1c7328e268758ca09eeec..9b691ecb3f8e7c953348f2e2f63e63b55b3513ef 100644 (file)
@@ -85,6 +85,17 @@ function DB_query_array($query)
   return $return;
 }
 
+function DB_query_array_all($query)
+{
+  $result = array();
+  
+  $queryresult  = DB_query($query);
+  while($row = DB_fetch_array($queryresult))
+    $result[] = $row;
+
+  return $result;
+}
+
 function DB_get_passwd_by_name($name)
 {
   $r = DB_query_array("SELECT password FROM User WHERE fullname=".DB_quote_smart($name)."");
@@ -705,6 +716,19 @@ function DB_get_PREF($myid)
   else
     $PREF["email"]="emailnonaddict";
 
+  /* Autosetup */
+  $r = DB_query_array("SELECT value FROM User_Prefs".
+                     " WHERE user_id='$myid' AND pref_key='autosetup'" );
+  if($r)
+    {
+      if($r[0]=='yes')
+       $PREF['autosetup']='yes';
+      else
+       $PREF['autosetup']='no';
+    }
+  else
+    $PREF['autosetup']='no';
+
   return $PREF;
 }