X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fadmin.php;h=347e66e5865732c8cb18cbea119c7c8de672fcab;hb=ad47a0aa4c6a13b4e4d051f7159641204707d11c;hp=d0e770f43906c6080e4cdb1d2c9f79bd8f3503e5;hpb=ba6ae0466e1dbc75852f4b8e8bfa8c815e81504a;p=platal.git diff --git a/modules/admin.php b/modules/admin.php index d0e770f..347e66e 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -1,6 +1,6 @@ id(), Post::i('del_profile')); + $user->id(), Post::i('del_profile')); + XDB::execute('DELETE FROM profiles + WHERE pid = {?}', + Post::i('del_profile')); } else if (!Post::blank('new_profile')) { $profile = Profile::get(Post::t('new_profile')); if (!$profile) { @@ -928,7 +931,7 @@ class AdminModule extends PLModule VALUES (100, {?}, {?}, {?}, {?}, {?}, {?}, \'primary\')', $pid, $eduSchools[Profile::EDU_X], $degreeid, $entry_year, $grad_year, $promotion); XDB::execute('INSERT INTO accounts (hruid, type, is_admin, state, full_name, directory_name, - display_name, sort_name, lastname, firstname, sex, best_domain) + sort_name, display_name, lastname, firstname, sex, best_domain) VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', $infos['hrid'], $type, 0, 'pending', $fullName, $directoryName, $sortName, $firstname, $lastname, $firstname, $sex, $best_domain); @@ -1165,7 +1168,9 @@ class AdminModule extends PLModule $r = XDB::iterator('SHOW COLUMNS FROM requests_answers'); while (($a = $r->next()) && $a['Field'] != 'category'); - $page->assign('categories', $categories = explode(',', str_replace("'", '', substr($a['Type'], 5, -1)))); + $categories = explode(',', str_replace("'", '', substr($a['Type'], 5, -1))); + sort($categories); + $page->assign('categories', $categories); $hidden = array(); $res = XDB::query('SELECT hidden_requests @@ -2143,5 +2148,5 @@ class AdminModule extends PLModule } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>