Exemplo n.º 1
0
     echo "<td><input type=\"text\" class=\"textbox\" maxlength=\"50\" name=\"group_leader\" value=\"{$group_leader}\" size=\"30\" disabled /></td></tr>";
 }
 echo '<tr><td valign="top">' . $groups_members . ':</td><td>';
 $GO_GROUPS->get_users_in_group($group_id, "name", "ASC");
 echo '<select name="group_users[]" multiple="true" style="width: 250px;height: 100px;" class="textbox" ' . $disabled . '>';
 while ($GO_GROUPS->next_record()) {
     if ($GO_GROUPS->f('last_name')) {
         $middle_name = $GO_GROUPS->f('middle_name') == '' ? '' : $GO_GROUPS->f('middle_name') . ' ';
         //$name = $GO_GROUPS->f('first_name').' '.$middle_name.$GO_GROUPS->f('last_name');
         $name = $GO_GROUPS->f('last_name') . ' ' . $middle_name . $GO_GROUPS->f('first_name');
         echo '<option value="' . $GO_GROUPS->f('id') . '">' . $name . '</option>';
     } else {
         //TODO: get_users_in_group should return all info!
         //move profiles into abstract LDAP classes
         require_once $GO_CONFIG->class_path . 'profiles.class.inc';
         $profiles = new profiles();
         if ($profile = $profiles->get_profile($GO_GROUPS->f('user_id'))) {
             $middle_name = $profile["middle_name"] == '' ? '' : $profile["middle_name"] . ' ';
             //$name = $profile["first_name"].' '.$middle_name.$profile["last_name"];
             $name = $profile["last_name"] . ' ' . $middle_name . $profile["first_name"];
             echo '<option value="' . $GO_GROUPS->f('user_id') . '">' . $name . '</option>';
         }
     }
 }
 echo '</select>';
 if ($enabled) {
     echo '<table><tr><td>';
     $button = new button($cmdAdd, 'javascript:add_users()', 60);
     echo '</td><td>';
     $button = new button($cmdDelete, 'javascript:delete_users()', 60);
     echo '</td><td>';
Exemplo n.º 2
0
$hacks6 = $results6->fetchAll(PDO::FETCH_ASSOC);
$hacks7 = $results7->fetchAll(PDO::FETCH_ASSOC);
$hacks8 = $results8->fetchAll(PDO::FETCH_ASSOC);
$hacks9 = $results9->fetchAll(PDO::FETCH_ASSOC);
$hacks10 = $results10->fetchAll(PDO::FETCH_ASSOC);
$hacksGeneral = array("k" => $hacks1);
$hacksTags = array("k" => $hacks2);
$hacksSupplies = array("k" => $hacks3);
$hacksInstructions = array("k" => $hacks4);
$userProfile = array("k" => $hacks5);
$userAbility = array("k" => $hacks6);
$userAnswers = array("k" => $hacks7);
$userQuestions = array("k" => $hacks8);
$userFollowing = array("k" => $hacks9);
$hackTips = array("k" => $hacks10);
$profiles = new profiles();
$hackId = array("k" => $hacks5);
if (isset($_POST['login'])) {
    $profiles->verify_username_password($_POST['username'], $_POST['password'], $hackId);
}
if (isset($_POST['register'])) {
    $profiles->register($_POST['usernameR'], $_POST['passwordR'], $_POST['password1R'], $_POST['fName'], $_POST['lName'], $_FILES['proPic'], $_FILES['proPic']['name'], $_FILES['proPic']['tmp_name']);
}
if (isset($_POST['logout'])) {
    $profiles->log_user_out();
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    setcookie("u", $_POST['follow']);
}
?>