Advertisement
Guest User

login redirect

a guest
Dec 4th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.66 KB | None | 0 0
  1. common.php global hooks
  2.  
  3. find
  4.  
  5. /* ======== Local/GMT time ======== */
  6.  
  7. $usr['timetext'] = sed_build_timezone($usr['timezone']);
  8. $usr['gmttime'] = @date($cfg['dateformat'],$sys['now_offset']).'';
  9.  
  10. /* ======== Local/ Redirect ======== */
  11.  
  12. add below
  13.  
  14. if (($cfg['rd_option'] == "Login Redirect his place")&&($usr['id'] < 1))
  15.     {
  16.     $rd_loc = $_SERVER["PHP_SELF"];
  17.     $rd_extra = $_SERVER["QUERY_STRING"];
  18.     if (!empty($rd_extra)) { $rd_extra = "?".$rd_extra; }
  19.     $temp = explode("/",$rd_loc);
  20.     $rd_loc = $temp[count($temp)-1];
  21.    
  22. if (($rd_loc != "users.php")&&($rd_loc != "message.php"))
  23.         {
  24.         $sql_update_online = sed_sql_query("UPDATE $db_redirecter SET rd_location='".$rd_loc.$rd_extra."',rd_lastseen='".time()."' WHERE rd_ip='".$_SERVER["REMOTE_ADDR"]."'");
  25.         }
  26.        
  27. if (sed_sql_affectedrows() == 0)
  28.             { // No record, insert
  29.             $sql_insert_online = sed_sql_query("INSERT INTO $db_redirecter (rd_ip,rd_location,rd_lastseen) VALUES ('".$_SERVER["REMOTE_ADDR"]."','".$rd_loc.$rd_extra."','".time()."')");
  30.             }  
  31.  
  32.     }
  33.  
  34.  
  35. functions.admin.php find
  36. $result[] = array ('main', '20', 'shieldzhammer', 2, '25', array(5,10,15,20,25,30,40,50,100));
  37.  
  38. add below
  39. $result[] = array ('main', '21', 'rd_option', 2, 'Login Redirect his place', array('Login Redirect his place','Use the special value'));
  40. $result[] = array ('main', '22', 'rd_page_1', 1, 'users.php?m=profile', '');
  41. $result[] = array ('main', '23', 'rd_page_2', 1, '', '');
  42.  
  43. insert into mysql
  44.  
  45. $sql = sed_sql_query("CREATE TABLE ".$cfg['mysqldb']."redirecter (
  46.  `rd_ip` varchar(15) NOT NULL default '',
  47.  `rd_location` varchar(100) NOT NULL default '',
  48.  `rd_lastseen` int(11) NOT NULL default '0'
  49. ) ENGINE=MyISAM;");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement