no more php warnings if userid isn't set

This commit is contained in:
Uwe Steinmann 2014-07-07 15:44:46 +02:00
parent a2206a6551
commit eb909aa100

View File

@ -46,6 +46,7 @@ if (isset($_GET["userid"]) && (!is_numeric($_GET["userid"]) || $_GET["userid"]<-
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
$userid = 0;
if(isset($_GET["userid"]))
$userid = $_GET["userid"];
@ -71,7 +72,7 @@ if ($document->getAccessMode($user) < M_READ) {
// delete notification
if ($action == "delnotify"){
if (isset($userid)) {
if ($userid) {
$obj = $dms->getUser($userid);
$res = $document->removeNotify($userid, true);
} elseif (isset($groupid)) {
@ -134,7 +135,7 @@ if ($action == "delnotify"){
// add notification
else if ($action == "addnotify") {
if ($userid != -1) {
if ($userid) {
$res = $document->addNotify($userid, true);
switch ($res) {
case -1: