Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

User Log doesn't work correct

Asked Modified Viewed 1,924 times
D
Dav
D
Dav 10
Greets, David.
PS.: Sorry for my bad English, i am from Austria =)
  • Junior Member, joined since
  • Contributed 29 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Junior Member

Hello Peoples ;)

currently, a Member on phpfusion-support.de asked because of the Userlog and said, there will be no UserID inserted into the Database. After checking the Scoure, he has right.

Search in "includes/classes/UserFieldsInput.class.php" for:
private function _saveUserLog() {
      $i = 0; $sql = "";

      foreach ($this->_userLogData AS $field => $value) {
         if ($this -> userData[$field] != $value) {
            if ($i == 0) {
               $sql = "INSERT INTO ".DB_USER_LOG." (userlog_user_id, userlog_field, userlog_value_new, userlog_value_old, userlog_timestamp) VALUES ";
            }
            $sql .= ($i > 0 ? ", " : "")."('".$this->userData[$field]."', '".$field."', '".$value."', '".$this->userData[$field]."', '".time()."')";
            $i++;
         }
      }

           if ($sql != "") { $result = dbquery($sql); }
   }


And replace it with:
  private function _saveUserLog() {
      global $userdata;
     
      $i = 0; $sql = "";
      foreach ($this->_userLogData AS $field => $value) {
         if ($this -> userData[$field] != $value) {
            if ($i == 0) {
               $sql = "INSERT INTO ".DB_USER_LOG." (userlog_user_id, userlog_field, userlog_value_new, userlog_value_old, userlog_timestamp) VALUES ";
            }
            $sql .= ($i > 0 ? ", " : "")."('".$userdata['user_id']."', '".$field."', '".$value."', '".$this -> userData[$field]."', '".time()."')";
            $i++;
         }
      }

      if ($sql != "") { $result = dbquery($sql); }
   }


By the old Code, there will be insert the Fieldvalue and not the UserID ..

Bug exists in current Version v7.02.07, and above? (i looked into a v7.02.03 Version, there also still exists this error.)

Greets, David
0 replies

1 post

F
Falk
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

Nice catch, Thank you David!
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

F
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
D
D
Dav 10
Greets, David.
PS.: Sorry for my bad English, i am from Austria =)
  • Junior Member, joined since
  • Contributed 29 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet