Subversion Repositories ALCASAR

Rev

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

Rev 2311 Rev 2388
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 2311 2017-06-26 15:04:47Z tom.houdayer $
8
 * @version   $Id: ticket_voucher.php 2388 2017-08-22 22:59:55Z tom.houdayer $
9
 */
9
 */
10
 
10
 
11
require_once __DIR__ . '/../lib/alcasar/TicketsGenerator.php';
11
require_once __DIR__ . '/../lib/alcasar/TicketsGenerator.php';
12
require_once '/etc/freeradius-web/config.php';
12
require_once '/etc/freeradius-web/config.php';
13
require_once '../lib/sql/drivers/'.$config['sql_type'].'/functions.php';;
13
require_once '../lib/sql/drivers/'.$config['sql_type'].'/functions.php';;
Line 45... Line 45...
45
 
45
 
46
 
46
 
47
// Generate tickets
47
// Generate tickets
48
$ticketsGenerator = new TicketsGenerator(['language' => $langue_imp]);
48
$ticketsGenerator = new TicketsGenerator(['language' => $langue_imp]);
49
 
49
 
50
 
50
ob_start();
51
for ($i = 0; $i < $nbTickets; $i++) {
51
for ($i = 0; $i < $nbTickets; $i++) {
52
	// Generate username and password
52
	// Generate username and password
53
	$login  = generateRandomString(8);
53
	$login  = generateRandomString(8);
54
	$passwd = generateRandomString(12);
54
	$passwd = generateRandomString(12);
55
	$password = $passwd;
55
	$password = $passwd;
Line 87... Line 87...
87
		'sessionTimeout'  => $sto_imp,
87
		'sessionTimeout'  => $sto_imp,
88
		'maxDailySession' => $mds_imp,
88
		'maxDailySession' => $mds_imp,
89
		'expiration'      => $exp_imp
89
		'expiration'      => $exp_imp
90
	]);
90
	]);
91
}
91
}
92
 
-
 
-
 
92
$content_generation = ob_get_clean();
93
 
93
 
94
// Generate the PDF
94
// Generate the PDF
95
$ticketsGenerator->output();
95
$ret = $ticketsGenerator->output();
-
 
96
 
-
 
97
if (!$ret) {
-
 
98
	echo $content_generation;
-
 
99
	echo 'Error during tickets report generation';
-
 
100
}
96
 
101
 
97
 
102
 
98
/**
103
/**
99
 * Format time in seconds to days/hours/minutes/secondes.
104
 * Format time in seconds to days/hours/minutes/secondes.
100
 *
105
 *