7, September 2008

Version 0.93 released - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Version 0.93 released
« previous next »
Pages: 1 [2] Print

Author Topic: Version 0.93 released  (Read 749 times)
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #20 on: Jun 16, 2008, 11:08:48 PM »

No don't use this code, it is not sql injection safe....

Arghhh... i forgot... now it is? Wink
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #21 on: Jun 16, 2008, 11:15:45 PM »

Yeah, now it looks ok. Thanks for your contribution Wink

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #22 on: Jun 18, 2008, 03:35:16 PM »

UNTESTED CODE!!!

With the prevois Version of my code, Passwords would have been updated to plaintext. That's not what we want. So let's try this:

Code:
<?php

/*
   * Updates a property. Data must be in the form 'property' => 'value'
   * @param array
   * @return bool
   */
  
public function updateProperty($properties)
  {
    if(
is_array($properties) && count($properties) > 1)
    {
      
$i=1;
      
$query "UPDATE `".$this->dbTable."` SET ";

      foreach(
$properties AS $k => $v)
      {
        if(
$k == $tbFields['pass'])
        {
          switch(
strtolower($this->passMethod))
          {
            case 
'sha1':
              
$v sha1($v);
              break;
            case 
'md5' :
              
$v md5($v);
              break;
            default:
          }
        }
        
$query .= "`".$this->escape($k)."` = '".$this->escape($v)."'".(($i++ < count($properties)) ? ', ' ' ');
      }

      
$query .= "WHERE `".$this->tbFields['userID']."` = '".$this->userID."'";
      return 
mysql_query($query$this->dbConn); 
    }
  else
    return 
false;
  }
?>
« Last Edit: Jun 18, 2008, 04:50:46 PM by Downlord »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7723
Tags : php user class php class Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: 1 [2] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Version 0.93 released
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 07, 2008, 06:14:43 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.301
Total Topics: 7.479
Total Members: 3.904
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: Brandon

25 Guests, 3 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.