ahh... I believe this is the code necessary to add users...
I'm not sure how I would implement this into the registration, any takes?
[code:1]<?php
global $database, $my, $mosConfig_absolute_path, $mosConfig_live_site;
require_once("/administrator/components/com_uhp/functions.php"«»);
require_once("/administrator/components/com_uhp/uhp_config.php"«»);
$lists = array();
$where = array();
$where[] = "u.id is NULL ";
$database -> setQuery("SELECT h.* FROM #__users as h"
. "\nLEFT JOIN #__uhp as u ON u.user_id = h.id"
. (count($where) ? "\nWHERE " . implode(' AND ', $where) : ""«»)
);
if (!($users = $database -> loadObjectList())) {
mosRedirect("index2.php?option=$option", 'Access granted to all users.');
}
for ( $i = 0, $n = count( $users ); $i < $n; $i++ )
{
$userrow = &$users[$i];
$row = new mosuhp($database);
$row->user_id = $userrow->id;
$row->nick = $userrow->username;
$row->email = $userrow->email;
$row->website = "";
$row -> published = 0;
$row -> shownick = 0;
$row -> showemail = 0;
$row -> showwebsite = 0;
$row -> mypage = C9da9cc42;
$row -> _tbl_key = "id";
if (!$row -> check()){
echo "<script> alert('" . $row -> getError() . "'); window.history.go(-1); </script>\n";
exit();
}
if (!$row -> store()){
echo "<script> alert('" . $row -> getError() . "'); window.history.go(-1); </script>\n";
exit();
}
$row -> checkin();
}
mosRedirect("index2.php?option=$option","All users granted access"«»);
}
?>
[/code:1]
Post edited by: chaking, at: 2006/02/05 10:42