Code-Formatierungen und Anpassungen an neue Editoren

This commit is contained in:
2016-09-12 22:24:04 +00:00
parent 5ca973cb00
commit 73c64c5f65
46 changed files with 5167 additions and 5374 deletions

View File

@@ -1,37 +1,33 @@
<?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;' );
}
}
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;');
}
}