function subuser_add in Subuser 5
1 string reference to 'subuser_add'
- subuser_menu in ./
subuser.module - Implementation of hook_menu()
File
- ./
subuser.module, line 121
Code
function subuser_add() {
global $user;
$form['name'] = array(
"#type" => "textfield",
"#title" => "Username",
);
$form['mail'] = array(
"#type" => "textfield",
"#title" => "E-mail Address",
);
$form['pass'] = array(
"#type" => "password",
"#title" => "Password",
);
if ($user->uid == 1) {
$result = db_query("SELECT uid,name FROM users ORDER BY name");
while ($uu = db_fetch_object($result)) {
if ($uu->uid == 0 || $uu->uid == 1) {
continue;
}
$options[$uu->uid] = $uu->name;
}
$form['mainuid'] = array(
"#type" => "select",
"#options" => $options,
"#title" => "Main Account",
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Add Sub User'),
'#weight' => 30,
);
return $form;
}