Changeset 59

Show
Ignore:
Timestamp:
06/25/05 16:41:52 (7 years ago)
Author:
fsiler
Message:

clausen's user_info fixes; new TODO

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/soda/www/auth/user_info.php

    r57 r59  
     1 
    12<?php 
    2 if (($_SESSION['CAFFEINE_ADMIN'] == true) && 
    3     ($_POST['op'] == "deposit")) { 
    4   $result = mysql_query("UPDATE users SET balance=balance+{$_POST['amount']} WHERE uid={$_POST['uid']};"); 
    5   $result = mysql_query("INSERT INTO moneys (time,uid_source,uid_dest,amount) VALUES (NOW(),-1,{$_POST['uid']},{$_POST['amount']});"); 
     3 
     4  preg_match("/(.*)@.*/", apache_getenv('REMOTE_USER'), $remote_user); 
     5  print "<!-- remote_user $remote_user[1] -->\n"; 
     6 
     7if ($_POST['op'] == "deposit")  
     8
     9  $result = mysql_query("SELECT * FROM users WHERE username='{$remote_user[1]}';"); 
     10 
     11  $remote_user = mysql_fetch_row($result); 
     12  if  ($remote_user[15] == 't' ) 
     13  { 
     14    $result = mysql_query("UPDATE users SET balance=balance+{$_POST['amount']} WHERE uid={$_POST['uid']};"); 
     15    $result = mysql_query("INSERT INTO moneys (time,uid_source,uid_dest,amount) VALUES (NOW(),-1,{$_POST['uid']},{$_POST['amount']});"); 
     16  } 
     17  else  
     18  { 
     19    print "$remote_user[2] is not authorized to add money\n"; 
     20  } 
    621} 
    7 ?> 
    8  
    9 <?php  
    10 if ($_SESSION['CAFFEINE_ADMIN'] == true) 
    11 { 
    1222?> 
    1323  <table border="0" cellspacing="5" cellpadding="5"> 
     
    2232     </tr> </form> </table> 
    2333<?php 
    24 
    25 else 
     34if ($_POST['f_user'] != "") 
    2635{ 
    27    $f_user = $_SESSION['CAFFEINE_UNAME']; 
    28 
    29 if ($f_user != "") 
    30 
    31    $result = mysql_query("SELECT * FROM users WHERE username='$f_user';"); 
    32    if (mysql_num_rows($result) == 1) { 
     36   $result = mysql_query("SELECT * FROM users WHERE username='$_POST[f_user]';"); 
     37   if (mysql_num_rows($result) == 1)  
     38   { 
    3339      $user = mysql_fetch_row($result); 
    3440?> 
     
    5662    <br> 
    5763<?php 
    58     if ($CAFFEINE_ADMIN != "")
     64   
    5965      ?> 
    6066 <table border="0" cellspacing="5" cellpadding="5">