Beispiel #1
0
/**
*
**/
function form_add_account_2($account_new, $action, $values, $disabled = array())
{
    global $plugins;
    global $pv;
    global $pn;
    global $domain;
    global $givenName;
    global $sn;
    #global $values;
    global $plugins_exclusion;
    if (in_array($action, array('modify_account', 'update_account'))) {
        $submit_label = _("Modify account");
    } else {
        $submit_label = _("Add new account");
    }
    $tag = '<div class="row"><div class="col-md-6">';
    $tag .= '<div class="panel panel-default panel-primary">';
    $tag .= '<div class="panel-heading"><h3>' . _("Account") . ' ' . $account_new . '</h3></div>';
    $tag .= '<div class="panel-body">';
    $tag .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . '" name="add">' . "\n";
    $tag .= '<input type="hidden" name="action" value="' . $action . '" />' . "\n";
    $tag .= '<input type="hidden" name="account_new" value="' . $account_new . '" />' . "\n";
    $tag .= '<table class="table table-bordered">' . "\n";
    $tag .= '<tr class="warning"><td>' . _("Password") . '</td>' . "\n";
    $tag .= '<td><input autocomplete="off" type="password" class="form-control" name="password1" value="" size="50" maxlength="50" /></td></tr>' . "\n";
    $tag .= '<tr class="warning"><td>' . _("Confirm Password") . '</td>' . "\n";
    $tag .= '<td><input autocomplete="off" type="password" class="form-control" name="password2" value="" size="50" maxlength="50" /></td></tr>' . "\n";
    $tag .= '<tr class="warning"><td>' . _("Name") . ' *</td>' . "\n";
    $tag .= '<td><input type="text" class="form-control" name="givenname" value="' . stripslashes($givenName) . '" size="15" maxlength="50" /></td></tr>' . "\n";
    $tag .= '<tr class="warning"><td>' . _("Surname") . ' *</td>' . "\n";
    $tag .= '<td><input type="text" class="form-control" name="sn" value="' . stripslashes($sn) . '" size="15" maxlength="50" /></td></tr>' . "\n";
    $i = 0;
    foreach ($pv as $name => $p_value) {
        // Skip form if plugin is defined in $plugins_exclusion (mail||alias)
        if (in_array($name, $plugins_exclusion)) {
            // Search if the firsh OBJECTCLASSES defined in XML is present
            if (in_array($action, array('modify_account', 'update_account'))) {
                if (isset($values[0]["objectclass"])) {
                    $show_form = in_array(key($p_value["ACCOUNT"]["OBJECTCLASSES"]), $values[0]["objectclass"]) ? true : false;
                } else {
                    $show_form = isset($values[$name]);
                }
            } else {
                $show_form = $name == $pn || !in_array($pn, $plugins_exclusion) ? true : false;
            }
        } else {
            $show_form = true;
        }
        if ($show_form) {
            if ($p_value["ISACCOUNTRELATED"]) {
                $tag .= '<tr class="pluginActive" id="' . $name . '"><td>' . "\n";
                if (in_array($name, $plugins_exclusion)) {
                    $tag .= '<input type="radio" name="confirm[]" value="' . $name . '" checked="checked" />' . "\n";
                } else {
                    $tag .= '<input type="checkbox" name="confirm[]" value="' . $name . '" checked="checked" onClick="testing(this,\'' . $name . '\')" />' . "\n";
                }
                $tag .= '<b>' . $p_value["LABEL"] . '</b>' . "\n";
                $tag .= '</td><td>' . "\n";
                $tag .= form_template($name, $p_value["ACCOUNT"]["ATTRIBUTES"], $values) . "\n";
                $tag .= '</td></tr>' . "\n";
            }
        }
    }
    $tag .= '</table>' . "\n";
    $tag .= '<button type="submit" class="btn btn-primary">' . $submit_label . '</button>' . "\n";
    $tag .= '</form>' . "\n";
    $tag .= '</div></div>' . "\n";
    $tag .= '</div></div>' . "\n";
    return $tag;
}
function cadastro_entries()
{
    if (FrontUser::isLoggedIn()) {
        return success_template();
    }
    return form_template();
}
Beispiel #3
0
				<p class="alert alert-danger"><?php 
    echo array_shift($errors);
    ?>
</p>
				<?php 
}
?>
				
				<hr class="colorgraph">
                
                <?php 
echo form_template(form_input($login), form_error($login['name']));
?>
               				
                <?php 
echo form_template(form_input($password), form_error($password['name']));
?>
               								
	<?php 
if ($show_captcha) {
    ?>
		<div class="form-group">
		<table class="table">
		<?php 
    if ($use_recaptcha) {
        ?>
	<tr>
		<td colspan="2">
			<div id="recaptcha_image"></div>
		</td>
		<td>
				
				<?php 
if (is_array($errors) && count($errors) > 0) {
    ?>
				<p class="alert alert-danger"><?php 
    echo array_shift($errors);
    ?>
</p>
				<?php 
}
?>
				
				<hr class="colorgraph">
				
                <?php 
echo form_template(form_input($login), form_error($login['name']));
?>
                				
				<hr class="colorgraph">
				<div class="row">
					<div class="col-xs-6 col-sm-6 col-md-6">
                        <input type="submit" class="btn btn-lg btn-success btn-block" value="Reset Password">
					</div>
				</div>
			</fieldset>
        <?php 
echo form_close();
?>
	</div>
</div>