function FoF_Prefs($user_id) { global $FOF_USER_TABLE; $this->user_id = $user_id; $result = fof_safe_query("select user_prefs from {$FOF_USER_TABLE} where user_id = %d", $user_id); $row = mysql_fetch_array($result); $prefs = unserialize($row['user_prefs']); if (!is_array($prefs)) { $prefs = array(); } $this->prefs = $prefs; if ($user_id != 1) { $result = fof_safe_query("select user_prefs from {$FOF_USER_TABLE} where user_id = 1"); $row = mysql_fetch_array($result); $admin_prefs = unserialize($row['user_prefs']); if (!is_array($admin_prefs)) { $admin_prefs = array(); } $this->admin_prefs = $admin_prefs; } else { $this->admin_prefs = $prefs; } $this->populate_defaults(); if ($user_id == 1) { $this->prefs = array_merge($this->prefs, $this->admin_prefs); } }
function fof_db_authenticate($user_name, $user_password_hash) { global $FOF_USER_TABLE, $FOF_ITEM_TABLE, $FOF_ITEM_TAG_TABLE, $fof_connection, $fof_user_id, $fof_user_name, $fof_user_level; $result = fof_safe_query("select * from {$FOF_USER_TABLE} where user_name = '%s' and user_password_hash = '%s'", $user_name, $user_password_hash); if (mysql_num_rows($result) == 0) { return false; } $row = mysql_fetch_array($result); $fof_user_name = $row['user_name']; $fof_user_id = $row['user_id']; $fof_user_level = $row['user_level']; return true; }
.pass { color: green; } .warn { color: #a60; } </style> </head> <body><div> <center style="font-size: 20px;"><a href="http://feedonfeeds.com/">Feed on Feeds</a> - Installation</center><br> <?php if ($_GET['password'] && $_GET['password'] == $_GET['password2']) { $password_hash = md5($_GET['password'] . 'admin'); fof_safe_query("insert into {$FOF_USER_TABLE} (user_id, user_name, user_password_hash, user_level) values (1, 'admin', '%s', 'admin')", $password_hash); echo '<center><b>OK! Setup complete! <a href=".">Login as admin</a>, and start subscribing!</center></b></div></body></html>'; } else { if ($_GET['password'] != $_GET['password2']) { echo '<center><font color="red">Passwords do not match!</font></center><br><br>'; } ?> Checking compatibility... <?php if ($php_ok) { echo "<span class='pass'>PHP ok...</span> "; } else { echo "<br><span class='fail'>Your PHP version is too old!</span> Feed on Feeds requires at least PHP 4.3.2. Sorry!"; echo "</div></body></html>"; exit;