mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Fixed session path warnings during setup, Fixed deleting users from database
This commit is contained in:
parent
8c62326875
commit
7b0d6c3926
@ -277,6 +277,11 @@ class Common {
|
||||
} catch( exception $e ) {
|
||||
}
|
||||
|
||||
if( ! is_dir( SESSIONS_PATH ) ) {
|
||||
|
||||
mkdir( SESSIONS_PATH );
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
if( ! defined( 'SESSION_ID' ) ) {
|
||||
|
@ -55,7 +55,12 @@ class User {
|
||||
$query = "
|
||||
DELETE FROM projects
|
||||
WHERE owner=( SELECT id FROM users WHERE username=? )
|
||||
AND ( SELECT COUNT(*) FROM access WHERE project = projects.id AND WHERE user <> ( SELECT id FROM users WHERE username=? ) );";
|
||||
AND (
|
||||
SELECT COUNT(*)
|
||||
FROM access
|
||||
WHERE project = projects.id
|
||||
AND user <> ( SELECT id FROM users WHERE username=? )
|
||||
) = 0;";
|
||||
$bind_variables = array(
|
||||
$username,
|
||||
$username
|
||||
@ -70,18 +75,18 @@ class User {
|
||||
|
||||
if( $return > 0 ) {
|
||||
|
||||
echo formatJSEND( "success", null );
|
||||
exit( formatJSEND( "success", null ) );
|
||||
} else {
|
||||
|
||||
echo formatJSEND( "error", "Error deleting user information." );
|
||||
exit( formatJSEND( "error", "Error deleting user information." ) );
|
||||
}
|
||||
} else {
|
||||
|
||||
echo formatJSEND( "error", "Error deleting user project information." );
|
||||
exit( formatJSEND( "error", "Error deleting user project information." ) );
|
||||
}
|
||||
} else {
|
||||
|
||||
echo formatJSEND( "error", "Error deleting user option information." );
|
||||
exit( formatJSEND( "error", "Error deleting user option information." ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user