Skip to content
Permalink
Browse files

restrict assuming reports from other admins to old reports, to avoid …

…conflicts when processing new ones
  • Loading branch information...
following
following committed Jan 30, 2013
1 parent d0de099 commit aedd718daaa43228e32dc7fbac33dec3d6d7e8db
Showing with 5 additions and 3 deletions.
  1. +3 −1 htdocs/adminreports.php
  2. +2 −2 htdocs/doc/sql/static-data/data.sql
@@ -26,8 +26,10 @@
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
$ownerid = isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid']+0 : 0;
$adminid = sql_value("SELECT `adminid` FROM `cache_reports` WHERE `id`=&1", 0, $rid);
$age = sql_value("SELECT DATEDIFF(NOW(),`lastmodified`) FROM `cache_reports` WHERE `id`=&1", 0, $rid);
if (isset($_REQUEST['assign']) && $rid > 0) // && $adminid == 0)
if (isset($_REQUEST['assign']) && $rid > 0 &&
($adminid == 0 || ($adminid != $login->userid && $age >= 14)))
{
sql("UPDATE `cache_reports` SET `status`=2, `adminid`=&2 WHERE `id`=&1", $rid, $login->userid);
$tpl->redirect('adminreports.php?id='.$rid);
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('777', 'DE', 'Urheberrechtsverletzung', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('778', 'DE', 'Cache ist weg', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('779', 'DE', 'Sonstiges', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('780', 'DE', 'Der Bericht ist bereits einem anderen Admin zugeordnet!', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('780', 'DE', 'Der Bericht ist bereits einem anderen Admin zugeordnet! Du kannst ihn erst übernehmen, wenn er mindestens zwei Wochen alt ist.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('781', 'DE', 'Der Bericht wurde dir bereits zugeordnet!', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('782', 'DE', 'Du kannst diesen Bericht nicht bearbeiten, weil er bereits von einem anderen Admin bearbeitet wird.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('783', 'DE', 'Um einen Bericht zu bearbeiten, musst du ihn dir zuordnen!', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('777', 'EN', 'Copyright violation', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('778', 'EN', 'Cache is gone', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('779', 'EN', 'Other reason', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('780', 'EN', 'This report is already assigned to another admin!', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('780', 'EN', 'This report is already assigned to another admin! It must be at least two weeks old before you can assume it.', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('781', 'EN', 'This report is already assigned to you! ', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('782', 'EN', 'You cannot work on this report, it is already assigned to another admin!', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('783', 'EN', 'To work on a report you have to assign it to you!', '2010-08-28 11:48:08');

0 comments on commit aedd718

Please sign in to comment.
You can’t perform that action at this time.