} /***********************************************************************\ * Display the page: \***********************************************************************/ admin_page_head("New Users"); echo "<h2>Recently joined:</h2>\n"; echo "These are the most recent " . $limit . " users to join the project.<br>\n"; echo "Clicking on a name opens a user management page <i>in another window or tab</i>\n"; echo "<form name=\"new_user_limit\" action=\"?\" method=\"GET\">\n"; echo "<label for=\"limit\">Limit displayed users to</label>\n"; echo "<input type=\"text\" value=\"" . $limit . "\" name=\"limit\" id=\"limit\" size=\"5\">"; echo "<input class=\"btn btn-default\" type=\"submit\" value=\"Display\">\n"; echo "</form>\n"; $query = "SELECT * FROM user ORDER BY create_time DESC LIMIT {$limit}"; $result = _mysql_query($query); if (_mysql_num_rows($result) < 1) { echo "There are no new users."; admin_page_tail(); } start_table(); table_header("ID", "Name", "Email", "Team", "Country", "Joined"); while ($row = _mysql_fetch_object($result)) { $id = $row->id; $name = $row->name; $email = $row->email_addr; $country = $row->country; $joined = time_str($row->create_time); $email_validated = $row->email_validated; $team_name = ""; if ($row->teamid > 0) { $team = BoincTeam::lookup_id($row->teamid);
function cherokee_mysql_num_rows($result) { if (!_is_result($result)) { return _mysql_num_rows($result); } if (!isset($result["_dbslayer"]["_rows"])) { return FALSE; } return $result["_dbslayer"]["_rows"]; }
// // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see <http://www.gnu.org/licenses/>. require_once '../inc/forum.inc'; require_once '../inc/util_ops.inc'; db_init(); admin_page_head('Manage user privileges'); start_table("align=\"center\""); row1("Current special users", '9'); echo "<tr><td>User</td>"; for ($i = 0; $i < S_NFLAGS; $i++) { echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n"; } echo "</tr>"; $result = _mysql_query("SELECT prefs.userid, prefs.special_user, user.id, user.name \n FROM forum_preferences as prefs, user \n WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id"); for ($i = 1; $i <= _mysql_num_rows($result); $i++) { $foo = _mysql_fetch_object($result); echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n"; echo "<input type=\"hidden\" name=\"userid\" value=\"{$foo->userid}\"\n <tr><td>{$foo->name} ({$foo->id})</td>\n "; for ($j = 0; $j < S_NFLAGS; $j++) { $bit = substr($foo->special_user, $j, 1); echo "<td><input type=\"checkbox\" name=\"role" . $j . "\" value=\"1\""; if ($bit == 1) { echo " checked=\"checked\""; } echo "></td>\n"; } echo "<td><input class=\"btn btn-default\" type=\"submit\" value=\"Update\"></form></td>"; echo "</tr>\n"; } echo "<tr><form action=\"manage_special_users_action.php\" method=\"POST\">\n";
$payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $payer_name = $_POST['first_name'] . " " . $_POST['last_name']; $ip = $_SERVER['REMOTE_ADDR']; $agent = strtolower($_SERVER[HTTP_USER_AGENT]); if (!$fp) { // HTTP ERROR, might want to do additional handling here } else { fputs($fp, $header . $req); while (!feof($fp)) { $res = fgets($fp, 1024); if (strcmp($res, "VERIFIED") == 0) { $item_array = explode("_", $item_number); $payment_id = abs($item_array[0]); $order_time = abs($item_array[1]); $result = _mysql_query("SELECT * FROM donation_paypal WHERE order_time = '{$order_time}' AND id = '{$payment_id}' AND processed = '0'"); $num_rows = _mysql_num_rows($result); if ($num_rows == 1) { $row = _mysql_fetch_object($result); $userid = $row->userid; _mysql_query("UPDATE donation_paypal SET processed = '1', payment_time = '" . time() . "', item_name = '{$item_name}', payment_status = '{$payment_status}', payment_amount = '{$payment_amount}', payment_fee = '{$payment_fee}', payment_currency = '{$payment_currency}', txn_id = '{$txn_id}', receiver_email = '{$receiver_email}', payer_email = '{$payer_email}', payer_name = '{$payer_name}' WHERE id = '{$payment_id}'"); if ($userid > 0) { _mysql_query("UPDATE user SET donated = '1' WHERE id = '{$userid}'"); } } } } fclose($fp); }