3d2f35a7ddd509c0b995f16df4c913eec8b98cf6
4 require_once 'connect.db.inc.php';
6 $globals->debug
= 0; // Do not store backtraces.
8 $it = XDN
::rawIterator('SELECT uid, full_name, email, type
10 WHERE type NOT IN (\'x\', \'master\', \'phd\')');
11 while ($item = $it->next()) {
12 if ($item['type'] == 'virtual') {
14 $lastname = $item['full_name'];
15 } elseif (strpos(' ', $item['full_name'])) {
16 list($firstname, $lastname) = explode(' ', $item['full_name']);
18 list($local_part, ) = explode('@', strtolower($item['email']));
19 $parts = explode('.', $local_part);
20 if (count($parts) == 1) {
21 $lastname = ucfirst($local_part);
24 $firstname = ucfirst($parts[0]);
25 $lastname = ucwords(implode(' ', array_slice($parts, 1)));
28 XDB
::execute('UPDATE accounts
29 SET firstname = {?}, lastname = {?}',
30 $firstname, $lastname);
33 /* vim:set et sw=4 sts=4 ts=4: */