Subversion Repositories ALCASAR

Rev

Rev 2698 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2698 Rev 2699
Line 3... Line 3...
3
 * Print tickets of new users
3
 * Print tickets of new users
4
 *
4
 *
5
 * @author    Tom Houdayer
5
 * @author    Tom Houdayer
6
 * @copyright Copyright (C) ALCASAR (http://www.alcasar.net)
6
 * @copyright Copyright (C) ALCASAR (http://www.alcasar.net)
7
 * @license   GPL-3.0
7
 * @license   GPL-3.0
8
 * @version   $Id: ticket_voucher.php 2698 2019-02-05 10:25:12Z tom.houdayer $
8
 * @version   $Id: ticket_voucher.php 2699 2019-02-05 10:29:25Z tom.houdayer $
9
 */
9
 */
10
 
10
 
11
require_once __DIR__ . '/../lib/alcasar/TicketsGenerator.php';
11
require_once __DIR__ . '/../lib/alcasar/TicketsGenerator.php';
12
$langue_imp = ((isset($_POST['langue_imp'])) ? $_POST['langue_imp'] : 'en');
12
$langue_imp = ((isset($_POST['langue_imp'])) ? $_POST['langue_imp'] : 'en');
13
require_once __DIR__ . '/../lib/langues_imp.php';
13
require_once __DIR__ . '/../lib/langues_imp.php';
Line 72... Line 72...
72
 
72
 
73
ob_start();
73
ob_start();
74
$nbFailUsers = 0;
74
$nbFailUsers = 0;
75
for ($i = 0; $i < $nbTickets; $i++) {
75
for ($i = 0; $i < $nbTickets; $i++) {
76
	// Generate username and password
76
	// Generate username and password
77
	$username = generateRandomString(8);
77
	$login    = generateRandomString(8);
78
	$password = generateRandomString(12);
78
	$password = generateRandomString(12);
79
	
79
	
80
	// Check user exist
80
	// Check user exist
81
	require '../lib/'.$config['general_lib_type'].'/user_info.php';
81
	require '../lib/'.$config['general_lib_type'].'/user_info.php';
82
	if ($user_exists === 'yes') {
82
	if ($user_exists === 'yes') {
Line 87... Line 87...
87
	// Create user in database
87
	// Create user in database
88
	require '../lib/'.$config['general_lib_type'].'/create_user.php';
88
	require '../lib/'.$config['general_lib_type'].'/create_user.php';
89
 
89
 
90
	// Add user ticket
90
	// Add user ticket
91
	$ticketsGenerator->addTicket([
91
	$ticketsGenerator->addTicket([
92
		'username'        => $username,
92
		'username'        => $login,
93
		'password'        => $password,
93
		'password'        => $password,
94
		'maxAllSession'   => $userAttr['Max-All-Session'],
94
		'maxAllSession'   => $userAttr['Max-All-Session'],
95
		'sessionTimeout'  => $userAttr['Session-Timeout'],
95
		'sessionTimeout'  => $userAttr['Session-Timeout'],
96
		'maxDailySession' => $userAttr['Max-Daily-Session'],
96
		'maxDailySession' => $userAttr['Max-Daily-Session'],
97
		'expiration'      => $userAttr['Expiration']
97
		'expiration'      => $userAttr['Expiration']