'admin/account/watch' => $this->make_hook('account_watch', AUTH_MDP, 'admin'),
'admin/account/types' => $this->make_hook('account_types', AUTH_MDP, 'admin'),
'admin/jobs' => $this->make_hook('jobs', AUTH_MDP, 'admin,edit_directory'),
+ 'admin/profile' => $this->make_hook('profile', AUTH_MDP, 'admin,edit_directory')
);
}
}
}
}
+
+ function handler_profile(&$page)
+ {
+ $page->changeTpl('admin/profile.tpl');
+
+ if (Post::has('checked')) {
+ S::assert_xsrf_token();
+ $res = XDB::iterator('SELECT DISTINCT(pm.pid), pd.public_name
+ FROM profile_modifications AS pm
+ INNER JOIN profile_display AS pd ON (pm.pid = pd.pid)
+ WHERE pm.type = \'self\'');
+
+ while ($profile = $res->next()) {
+ if (Post::has('checked_' . $profile['pid'])) {
+ XDB::execute('DELETE FROM profile_modifications
+ WHERE type = \'self\' AND pid = {?}', $profile['pid']);
+
+ $page->trigSuccess('Profil de ' . $profile['public_name'] . ' vérifié.');
+ }
+ }
+ }
+
+ $res = XDB::iterator('SELECT p.hrpid, pm.pid, pd.directory_name, GROUP_CONCAT(pm.field SEPARATOR \', \') AS field
+ FROM profile_modifications AS pm
+ INNER JOIN profiles AS p ON (pm.pid = p.pid)
+ INNER JOIN profile_display AS pd ON (pm.pid = pd.pid)
+ WHERE pm.type = \'self\'
+ GROUP BY pd.directory_name
+ ORDER BY pd.directory_name');
+ $page->assign('updates', $res);
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, NOW())
ON DUPLICATE KEY UPDATE uid = VALUES(uid), oldText = IF(VALUES(type) != type, VALUES(oldText), oldText),
newText = VALUES(newText), type = VALUES(type), timestamp = NOW()',
- $this->pid(), $user->id(), $field, $values[0], $values[1], ($owner->id() == $user->id()) ? 'self' : 'third_party');
+ $this->pid(), $user->id(), Profile::$descriptions[$field], $values[0], $values[1],
+ ($owner->id() == $user->id()) ? 'self' : 'third_party');
}
}
return true;