caudium-commits AT caudium.net
Caudium CVS Commits list

CVS: caudium/server/modules/graphics pikegraphy.pike,1.9,1.10


chronological Thread 
  • From: "Bill Welliver" <hww3 AT cvs.caudiumforge.net>
  • To: caudium-commits AT caudium.net
  • Subject: CVS: caudium/server/modules/graphics pikegraphy.pike,1.9,1.10
  • Date: Fri, 22 Apr 2005 18:26:49 +0000

Update of /cvs/caudium/caudium/server/modules/graphics
In directory cvs.caudiumforge.net:/tmp/cvs-serv26245

Modified Files:
        pikegraphy.pike 
Log Message:
thumbnails are a more sane max largest dimension of 100px.
we also use caudium authentication rather than a module specific user 
database.
security level is still housed in a table; we should move that to caudium 
authentication, too.


Index: pikegraphy.pike
===================================================================
RCS file: /cvs/caudium/caudium/server/modules/graphics/pikegraphy.pike,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- pikegraphy.pike     19 Sep 2004 13:44:44 -0000      1.9
+++ pikegraphy.pike     22 Apr 2005 18:26:47 -0000      1.10
@@ -51,8 +51,6 @@
 
 CREATE TABLE users (
   login char(20) DEFAULT '' NOT NULL,
-  pass char(32) DEFAULT '' NOT NULL,
-  cookieval char(128) DEFAULT '' NOT NULL,
   seclevel int(11) DEFAULT '0' NOT NULL,
   PRIMARY KEY (login)
 );
@@ -60,7 +58,7 @@
 */
 
 /*
- * $Id: pikegraphy.pike,v 1.9 2004/09/19 13:44:44 hww3 Exp $
+ * $Id: pikegraphy.pike,v 1.10 2005/04/22 18:26:47 hww3 Exp $
  */
 inherit "caudiumlib";
 inherit "module";
@@ -77,7 +75,7 @@
 //! type: MODULE_PARSER
 //! inherits: caudiumlib
 //! inherits: module
-//! cvs_version: $Id: pikegraphy.pike,v 1.9 2004/09/19 13:44:44 hww3 Exp $ 
+//! cvs_version: $Id: pikegraphy.pike,v 1.10 2005/04/22 18:26:47 hww3 Exp $ 
 //
 
 constant module_type  = MODULE_PARSER;
@@ -208,49 +206,24 @@
  }
 
 if (id->variables && id->variables->login) {
-  cnt += "</td><td align=left>";
-  cnt += "<form method=POST action=\"" + id->not_query + "\">";
-  cnt += "Login :    <input name=\"user\" size=20><br>";
-  cnt += "Password : <input type=\"password\" name=\"pass\" size=20>";
-  cnt += "<input type=\"hidden\" name=\"startlogin\" value=\"1\">";
-  cnt += "<input type=\"hidden\" name=\"dir\" value=\""+dir+"\">";
-  cnt += "<input type=\"submit\" value=\"Login\">";
-  cnt += "</form>";
-//  cnt += "\t</td>";
-//  cnt += "</tr>\n</table>";
-  return cnt;
+  return "<if user=\"any\" not><auth-required></if>";
  }
 
-if (id->variables && id->variables->startlogin) {
+else if (id->variables && id->get_user()) {
    object db = SQLConnect(QUERY(sqlserver));
-   array x = (db->query("select * from users where 
login=\""+id->variables->user+"\" and pass=\""+id->variables->pass+"\""));
+   array x = (db->query("select * from users where login=\"" +
+         id->get_user()->username + "\""));
    if ( (sizeof(x)) != 0 ) {
-       cnt += "<set_cookie name=LoginValue value=\""+x[0]->cookieval+"\" 
minutes=15>";
         if ((int)x[0]->seclevel== 999) {
             admin=1;
             userlevel=999;
         } else {
             userlevel=(int)x[0]->seclevel;
         }
-        username = x[0]->login;
+        username = id->get_user()->username;
         logging = 1;
    }
-} else {
-   if (id->cookies && id->cookies->LoginValue ) {
-       object db = SQLConnect(QUERY(sqlserver));
-       array x = (db->query("select * from users where 
cookieval=\""+id->cookies->LoginValue+"\" "));
-       if ( sizeof(x) == 1 ) {
-          if ((int)x[0]->seclevel==999) {
-              admin=1;
-              userlevel=999;
-          } else {
-              userlevel=(int)x[0]->seclevel;
-          }
-          username = x[0]->login;
-          logging = 1;
-       }
-   }
- }
+}
    
 if (id->variables && id->variables->dirlevel && admin == 1) {
    object db = SQLConnect(QUERY(sqlserver));
@@ -383,7 +356,7 @@
      for(int i = startpic; i<(sizeof(cnt_dir)) && 
i<QUERY(nb_pic_max)+startpic;i++) {
        cnt += "\t\t<td><a href=\"" + id->not_query 
        + "?display="+dir+"/"+replace_string(cnt_dir[i])+"\">";
-       cnt += "<cimg src=\""+QUERY(root_images)+dir+"/"+cnt_dir[i]+"\" 
format=jpeg quant=\"64\" maxwidth=\"100\" border=0 ></a></td>\n";
+       cnt += "<cimg src=\""+QUERY(root_images)+dir+"/"+cnt_dir[i]+"\" 
format=jpeg quant=\"64\" maxwidth=\"100\" maxheight=\"100\" border=0 
></a></td>\n";
 
        cnt += "\t\t<td align=left><a href=\"" + id->not_query 
        + "?display="+dir+"/"+replace_string(cnt_dir[i])+"\">";



  • CVS: caudium/server/modules/graphics pikegraphy.pike,1.9,1.10, Bill Welliver

Archive powered by MhonArc 2.6.10.

§