Пример #1
0
function dcrm_unslash($value)
{
    if (is_array($value)) {
        $value = array_map('dcrm_unslash', $value);
    } elseif (is_object($value)) {
        $vars = get_object_vars($value);
        foreach ($vars as $key => $data) {
            $value->{$key} = dcrm_unslash($data);
        }
    } elseif (is_string($value)) {
        $value = stripslashes($value);
    }
    return $value;
}
Пример #2
0
/**
 * Display installer setup form.
 */
function display_setup_form($error = null)
{
    global $step_language;
    $repo_title = isset($_POST['repo_title']) ? trim(dcrm_unslash($_POST['repo_title'])) : '';
    $repo_url = isset($_POST['repo_url']) ? trim(dcrm_unslash($_POST['repo_url'])) : BASE_URL;
    $user_name = isset($_POST['user_name']) ? trim(dcrm_unslash($_POST['user_name'])) : '';
    $admin_email = isset($_POST['admin_email']) ? trim(dcrm_unslash($_POST['admin_email'])) : '';
    if (!is_null($error)) {
        ?>
<p class="message"><?php 
        echo $error;
        ?>
</p>
<?php 
    }
    ?>
<form id="setup" method="post" action="setup-install.php?step=1&amp;<?php 
    echo $step_language;
    ?>
" novalidate="novalidate">
	<table class="form-table">
		<tr>
			<th scope="row"><label for="repo_title"><?php 
    _e('Repository Title');
    ?>
</label></th>
			<td><input name="repo_title" type="text" id="repo_title" size="25" value="<?php 
    echo $repo_title;
    ?>
" /></td>
		</tr>
		<tr>
			<th scope="row"><label for="repo_url"><?php 
    _e('Repository URL');
    ?>
</label></th>
			<td>
				<input name="repo_url" type="text" id="repo_url" size="25" value="<?php 
    echo $repo_url;
    ?>
" />
				<p><?php 
    _e('Displayed on the homepage for the user to add, and used for the autofill package\'s Depiction when import.');
    ?>
</p>
			</td>
		</tr>
		<tr>
			<th scope="row"><label for="user_login"><?php 
    _e('Username');
    ?>
</label></th>
			<td>
				<input name="user_name" type="text" id="user_login" size="25" value="<?php 
    echo $user_name;
    ?>
" />
				<p><?php 
    _e('Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.');
    ?>
</p>
			</td>
		</tr>
		<tr>
			<th scope="row">
				<label for="pass1"><?php 
    _e('Password, twice');
    ?>
</label>
				<p><?php 
    _e('A password will be automatically generated for you if you leave this blank.');
    ?>
</p>
			</th>
			<td>
				<input name="admin_password" type="password" id="pass1" size="25" value="" />
				<p><input name="admin_password2" type="password" id="pass2" size="25" value="" /></p>
				<div id="pass-strength-result"><?php 
    _e('Strength indicator');
    ?>
</div>
				<p><?php 
    _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ &amp; ).');
    ?>
</p>
			</td>
		</tr>
		<tr>
			<th scope="row"><label for="admin_email"><?php 
    _e('Your E-mail');
    ?>
</label></th>
			<td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php 
    echo $admin_email;
    ?>
" />
			<p><?php 
    _e('Double-check your email address before continuing.');
    ?>
</p></td>
		</tr>
	</table>
	<p class="step"><input type="submit" name="Submit" value="<?php 
    _e('Install DCRM');
    ?>
" class="button button-large" /></p>
</form>
<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.4.2/jquery.min.js"></script>
<script src="../js/password-strength.min.js" type="text/javascript"></script>
<script src="../js/zxcvbn-async.min.js" type="text/javascript"></script>
<script src="../js/zxcvbn.min.js" type="text/javascript"></script>
<script type='text/javascript'>
var pwsL10n = {"empty":"<?php 
    echo utf8_unicode(__('Strength indicator'));
    ?>
","short":"<?php 
    echo utf8_unicode(_x('Short', 'Password'));
    ?>
","bad":"<?php 
    echo utf8_unicode(_x('Bad', 'Password'));
    ?>
","good":"<?php 
    echo _x('Good', 'Password');
    ?>
","strong":"<?php 
    echo utf8_unicode(_x('Strong', 'Password'));
    ?>
","mismatch":"<?php 
    echo utf8_unicode(_x('Mismatch', 'Password'));
    ?>
"};
</script>
<?php 
}