<?php
ob_clean();
-if (empty($User['admin']))
+if (!$User or !$User->admin)
abort("geen beheersrechten", '401 unauthorised');
if ($_FILES) {
if (is_writable('../.git')) {
$gitmsg = preg_replace('/\.html$/', '', $filename).": edit from {$_SERVER['REMOTE_ADDR']}";
$gitcmd = 'git';
- $gitcmd .= ' -c user.name='.escapeshellarg($User['name']);
- $gitcmd .= ' -c user.email='.escapeshellarg("{$User['name']}@lijtweg.nl");
+ $gitcmd .= ' -c user.name='.escapeshellarg($User->name ?: $User->login);
+ $gitcmd .= ' -c user.email='.escapeshellarg($User->email ?: "{$User->login}@lijtweg.nl");
$gitcmd .= ' commit -q';
$gitcmd .= ' -m '.escapeshellarg($gitmsg);
$gitcmd .= ' -- '.escapeshellarg($filename);