2019-01-04 22:26:34 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web action file
|
|
|
|
// Copyright (C) 2019 ZoneMinder LLC
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
if ( !canEdit('System') ) {
|
2019-02-22 22:19:07 +08:00
|
|
|
ZM\Warning('Need System permissions to update donation');
|
2019-01-04 22:26:34 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $action == 'donate' && isset($_REQUEST['option']) ) {
|
|
|
|
$option = $_REQUEST['option'];
|
2019-11-05 23:07:42 +08:00
|
|
|
$nextReminder = time();
|
|
|
|
|
|
|
|
switch ( $option ) {
|
2019-01-04 22:26:34 +08:00
|
|
|
case 'go' :
|
2019-11-05 23:07:42 +08:00
|
|
|
// Ignore this, the caller will open the page itself, use a return to shortut the view=none
|
|
|
|
return;
|
2019-01-04 22:26:34 +08:00
|
|
|
case 'hour' :
|
2019-11-05 23:07:42 +08:00
|
|
|
$nextReminder += 60*60;
|
2019-01-04 22:26:34 +08:00
|
|
|
case 'day' :
|
2019-11-05 23:07:42 +08:00
|
|
|
$nextReminder += 24*60*60;
|
2019-01-04 22:26:34 +08:00
|
|
|
case 'week' :
|
2019-11-05 23:07:42 +08:00
|
|
|
$nextReminder += 7*24*60*60;
|
2019-01-04 22:26:34 +08:00
|
|
|
case 'month' :
|
2019-11-05 23:07:42 +08:00
|
|
|
$nextReminder += 30*24*60*60;
|
2019-03-06 02:10:04 +08:00
|
|
|
dbQuery("UPDATE Config SET Value = '".$nextReminder."' WHERE Name = 'ZM_DYN_DONATE_REMINDER_TIME'");
|
|
|
|
break;
|
2019-01-04 22:26:34 +08:00
|
|
|
case 'never' :
|
|
|
|
case 'already' :
|
2019-03-06 02:10:04 +08:00
|
|
|
dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_DYN_SHOW_DONATE_REMINDER'");
|
|
|
|
break;
|
|
|
|
default :
|
|
|
|
Warning("Unknown value for option in donate: $option");
|
|
|
|
break;
|
2019-01-04 22:26:34 +08:00
|
|
|
} // end switch option
|
2020-09-19 21:55:08 +08:00
|
|
|
$redirect = '?view=console';
|
2019-01-04 22:26:34 +08:00
|
|
|
}
|
|
|
|
?>
|