Einchecken des OnlineStands

This commit is contained in:
2016-09-07 14:36:03 +00:00
parent feed788c84
commit 53295535eb
241 changed files with 69161 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
define ( 'PATH_ROOT' , '../' );
include_once ( PATH_ROOT . '.config/config_global.php' );
include_once ( PATH_FNC . 'fnc_portal.php' );
$db = new mysqli ( DB_HOST , DB_USER , DB_PASS , DB_NAME );
$db -> set_charset ( 'utf8' );
$users = $db -> query ( 'SELECT * FROM users;' );
while ( $dat_user = $users -> fetch_assoc ( ) )
{
$update = '';
if ( $dat_user [ 'userUsername' ] === '' )
{
$update .= 'userUsername = "' . mb_strtolower ( substr ( $dat_user [ 'userFirstname' ] , 0 , 1 ) . $dat_user [ 'userLastname' ] ) . '"';
}
if ( $dat_user [ 'userPasswordOrg' ] === '' )
{
$update .= ( $update === '' )
? ''
: ' , ';
$newPassword = fnc_generatePW ( );
$update .= 'userPasswordOrgCrypt = "' . md5 ( $newPassword ) . '" , userPasswordOrg = "' . $newPassword . '"';
}
if ( $update !== '' )
{
$user_update = $db -> query ( 'UPDATE users SET ' . $update . ' WHERE userId = "' . $dat_user [ 'userId' ] . '" LIMIT 1;' );
}
}
?>