コード例 #1
0
ファイル: register.php プロジェクト: nterray/tuleap
function display_account_form($register_error)	{
    global $Language;

    $request =& HTTPRequest::instance();
    $purifier =& Codendi_HTMLPurifier::instance();

    $page = $request->get('page');

    if ($register_error) {
        print "<p><blink><b><span class=\"feedback\">$register_error</span></b></blink>";
    }
    $star = '<span class="highlight"><big>*</big></span>';
    $form_loginname = $request->exist('form_loginname')?$purifier->purify($request->get('form_loginname')):'';
    $form_realname  = $request->exist('form_realname')?$purifier->purify($request->get('form_realname')):'';
    $form_email     = $request->exist('form_email')?$purifier->purify($request->get('form_email')):'';
    $form_expiry     = $request->exist('form_expiry')?$purifier->purify($request->get('form_expiry')):'';
    if($request->exist('timezone') && is_valid_timezone($request->get('timezone'))) {
        $timezone = $request->get('timezone');
    } else {
        $timezone = 'None';
    }

    $form_register_purpose = $request->exist('form_register_purpose')?$purifier->purify($request->get('form_register_purpose')):'';

    ?>
<?php if($page == "admin_creation"){ ?>        
    <form action="/admin/register_admin.php?page=admin_creation" name="new_user" method="post"> 
<?php } else { ?>
    <form action="/account/register.php" method="post">
<?php }?>
<p><?php print $Language->getText('account_register', 'login').'&nbsp;'.$star; ?>:<br>
<input type="text" name="form_loginname" value="<?php echo $form_loginname; ?>">
<?php print $Language->getText('account_register', 'login_directions'); ?>
<?php user_display_choose_password($page); ?>
<P><?php print $Language->getText('account_register', 'realname').'&nbsp;'.$star; ?>:<br>
<INPUT size=40 type="text" name="form_realname" value="<?php echo $form_realname; ?>">
<?php print $Language->getText('account_register', 'realname_directions'); ?>
<P><?php print $Language->getText('account_register', 'email').'&nbsp;'.$star; ?>:<BR>
<INPUT size=40 type="text" name="form_email" value="<?php echo $form_email; ?>"><BR>
<?php print $Language->getText('account_register', 'email_directions'); ?>
<?php if($page == "admin_creation"){ ?>    
    <P><?php print $Language->getText('account_register', 'expiry_date')?>:<BR>
    <?php echo $GLOBALS['HTML']->getDatePicker("form_expiry", "form_expiry", $form_expiry); ?>
    <BR>
    <?php print $Language->getText('account_register', 'expiry_date_directions'); ?>
<?php } ?>
<P><?php print $Language->getText('account_register', 'tz').'&nbsp;'.$star; ?>:<BR>
<?php 
    echo html_get_timezone_popup ('timezone',$timezone); ?>
<P>
<?php
if($request->isPost() && $request->exist('Register') && !($request->get('form_mail_site')==1)){

	echo '<P><INPUT type="checkbox" name="form_mail_site" value="1" >';
	
}else{
	
	echo '<P><INPUT type="checkbox" name="form_mail_site" value="1" checked>';

}	
print $Language->getText('account_register', 'siteupdate');

if($request->isPost() && $request->exist('Register') && ($request->get('form_mail_va')==1)){

	echo '<P><INPUT type="checkbox" name="form_mail_va" value="1" checked>';
	
}else{
	
	echo '<P><INPUT type="checkbox" name="form_mail_va" value="1" >';

}
print $Language->getText('account_register', 'communitymail');

?>

<P>
<?
if ($GLOBALS['sys_user_approval'] == 1 || $page == "admin_creation") {
    print $Language->getText('account_register', 'purpose');
    if($page != "admin_creation") {
        print '&nbsp;'.$star;
        print ":<br>";
        print $Language->getText('account_register', 'purpose_directions');
    } else{
        print ":<br>";
        print $Language->getText('account_register', 'purpose_directions_admin');
    }
    echo '<textarea wrap="virtual" rows="5" cols="70" name="form_register_purpose">'.$form_register_purpose.'</textarea></p>';
} 
?>

<p>
<?php print $Language->getText('account_register', 'mandatory', $star); ?>
</p>
<?php

if($page == "admin_creation" && $GLOBALS['sys_allow_restricted_users'] == 1){

	if($request->isPost() && $request->exist('Register') && !($request->get('form_restricted')==1)){

		echo '<INPUT type="checkbox" name="form_restricted" value="1" >';
		
	}else{
		
		echo '<INPUT type="checkbox" name="form_restricted" value="1" checked>';
	
	}	

	print $Language->getText('account_register', 'restricted_user'); 
}
?>



<P>
<p><input type="submit" name="Register" value="<?php if($page != "admin_creation") print $Language->getText('account_register', 'btn_register'); 
else print $Language->getText('account_register', 'btn_activate');?>">
<?php
if($page == "admin_creation") {
	if($request->isPost() && $request->exist('Register') && ($request->get('form_send_email')==1)){

		echo '<INPUT type="checkbox" name="form_send_email" value="1" checked>';
		
	}else{
		
		echo '<INPUT type="checkbox" name="form_send_email" value="1" >';
	
	}
	print $Language->getText('account_register', 'send_email'); 
} else {
    include $Language->getContent('account/user_legal');
}

?>
</form>
<?
}
コード例 #2
0
ファイル: change_pw.php プロジェクト: uniteddiversity/tuleap
$em->processEvent('before_change_pw', array());
// ###### first check for valid login, if so, congratulate
$user_id = is_numeric($request->get('user_id')) ? (int) $request->get('user_id') : user_getid();
if (register_valid($user_id, $csrf, $em)) {
    $HTML->header(array('title' => $Language->getText('account_change_pw', 'title_success')));
    ?>
<p><b><? echo $Language->getText('account_change_pw', 'title_success'); ?></b>
<p><? echo $Language->getText('account_change_pw', 'message', array($GLOBALS['sys_name'])); ?>

<p><a href="/">[ <? echo $Language->getText('global', 'back_home');?> ]</a>
<?php 
} else {
    // not valid registration, or first time to page
    $HTML->includeJavascriptFile('/scripts/check_pw.js.php');
    $HTML->header(array('title' => $Language->getText('account_options', 'change_password')));
    ?>
<h2><? echo $Language->getText('account_change_pw', 'title'); ?></h2>
<form action="change_pw.php" method="post" autocomplete="off" >
<p><?
echo $csrf->fetchHTMLInput();
echo $Language->getText('account_change_pw', 'old_password'); ?>:
<br><input type="password" value="" name="form_oldpw">
<?php 
    user_display_choose_password('', is_numeric($request->get('user_id')) ? $request->get('user_id') : 0);
    ?>
<p><input type="submit" class="btn btn-primary" name="Update" value="<? echo $Language->getText('global', 'btn_update'); ?>">
</form>

<?php 
}
$HTML->footer(array());
コード例 #3
0
ファイル: user_changepw.php プロジェクト: pombredanne/tuleap
</h3>

<p><a href="/admin"><?php 
    echo $Language->getText('global', 'back');
    ?>
</a>.
<?php 
} else {
    // not valid registration, or first time to page
    $HTML->header(array('title' => $Language->getText('admin_user_changepw', 'title')));
    require_once 'common/event/EventManager.class.php';
    $em =& EventManager::instance();
    $em->processEvent('before_admin_change_pw', array());
    ?>
<h3><?php 
    echo $Language->getText('admin_user_changepw', 'header');
    ?>
</h3>
<form action="user_changepw.php" method="post">
<?php 
    user_display_choose_password('', $user_id);
    ?>
<p><input type="submit" class="btn btn-primary" name="Update" value="<?php 
    echo $Language->getText('global', 'btn_update');
    ?>
">
</form>

<?php 
}
$HTML->footer(array());