Project

General

Profile

« Previous | Next » 

Revision 351b8519

Added by Luiz Souza almost 10 years ago

Check if our version of roll data is valid and if necessary, initialize
the database.

This fix the case where the database is not initialized because the used
field in backup file is empty.

View differences:

src/etc/inc/voucher.inc
586 586
		foreach ($config['voucher'][$cpzone]['roll'] as $rollent) {
587 587

  
588 588
			$roll = $rollent['number'];
589
			$len = ($rollent['count'] >> 3) + 1;
590
			if (strlen(base64_decode($rollent['used'])) != $len)
591
				$rollent['used'] = base64_encode(str_repeat("\000", $len));
589 592
			voucher_write_used_db($roll, $rollent['used']);
590 593
			$minutes = $rollent['minutes'];
591 594
			$active_vouchers = array();

Also available in: Unified diff