]> git.wh0rd.org Git - tt-rss.git/commitdiff
handle last_login in editor/login sequence
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 18 Nov 2005 09:18:19 +0000 (10:18 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 18 Nov 2005 09:18:19 +0000 (10:18 +0100)
backend.php
functions.php

index 42707b09a650e5faef91f4a652aff6448e455a7d..4d0753b860bff0fb5b64116bb63dfcd2cc54ac26 100644 (file)
                </table>";
 
                $result = db_query($link, "SELECT 
-                               id,login,access_level
+                               id,login,access_level,last_login
                        FROM 
                                ttrss_users
                        ORDER by login");
                print "<p><table width=\"100%\" class=\"prefUserList\" id=\"prefUserList\">";
 
                print "<tr class=\"title\">
-                                       <td width=\"5%\">Select</td><td width='40%'>Login
-                                       </td>
-                                       <td width='40%'>Access Level</td></tr>";
+                                       <td width=\"5%\">Select</td>
+                                       <td width='30%'>Username</td>
+                                       <td width='30%'>Access Level</td>
+                                       <td width='30%'>Last login</td></tr>";
                
                $lnum = 0;
                
 
                                print "<td>".$line["login"]."</td>";            
                                print "<td>".$line["access_level"]."</td>";             
-                       
 
                        } else if (!$edit_uid || $subop != "edit") {
 
                                                
                        }
                                
-                       
+                       print "<td>".$line["last_login"]."</td>";               
+               
                        print "</tr>";
 
                        ++$lnum;
index 3985890b155d10ad5436bcdd66e2ab5815daebae..c35519109bea7849aae4b8303419ae8b08d1b4a1 100644 (file)
                        $_SESSION["name"] = db_fetch_result($result, 0, "login");
                        $_SESSION["access_level"] = db_fetch_result($result, 0, "access_level");
 
+                       db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " . 
+                               $_SESSION["uid"]);
+
                        return true;
                }