@@ -58,6 +58,9 @@ |
||
| 58 | 58 | return $this->fetchTemplate("exception/access-denied.tpl"); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $action |
|
| 63 | + */ |
|
| 61 | 64 | private function getLogEntry($action, User $user, PdoDatabase $database) |
| 62 | 65 | { |
| 63 | 66 | $logs = LogSearchHelper::get($database) |
@@ -8,9 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace Waca\Exceptions; |
| 10 | 10 | |
| 11 | -use Waca\DataObjects\Log; |
|
| 12 | 11 | use Waca\DataObjects\User; |
| 13 | -use Waca\Helpers\LogHelper; |
|
| 14 | 12 | use Waca\Helpers\SearchHelpers\LogSearchHelper; |
| 15 | 13 | use Waca\PdoDatabase; |
| 16 | 14 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * @param int $requestId |
| 38 | 38 | * @param PdoDatabase $db |
| 39 | 39 | * |
| 40 | - * @return array |
|
| 40 | + * @return DataObject[] |
|
| 41 | 41 | */ |
| 42 | 42 | public static function getRequestLogsWithComments($requestId, PdoDatabase $db) |
| 43 | 43 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @param PdoDatabase $database |
| 41 | 41 | * @param string $table |
| 42 | - * @param null $order Order by clause, excluding ORDER BY. |
|
| 42 | + * @param string $order Order by clause, excluding ORDER BY. |
|
| 43 | 43 | */ |
| 44 | 44 | protected function __construct(PdoDatabase $database, $table, $order = null) |
| 45 | 45 | { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function byUser($userId) |
| 62 | 62 | { |
| 63 | - $this->whereClause .=' AND user = ?'; |
|
| 63 | + $this->whereClause .= ' AND user = ?'; |
|
| 64 | 64 | $this->parameterList[] = $userId; |
| 65 | 65 | |
| 66 | 66 | return $this; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function byAction($action) |
| 77 | 77 | { |
| 78 | - $this->whereClause .=' AND action = ?'; |
|
| 78 | + $this->whereClause .= ' AND action = ?'; |
|
| 79 | 79 | $this->parameterList[] = $action; |
| 80 | 80 | |
| 81 | 81 | return $this; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function byObjectType($objectType) |
| 92 | 92 | { |
| 93 | - $this->whereClause .=' AND objecttype = ?'; |
|
| 93 | + $this->whereClause .= ' AND objecttype = ?'; |
|
| 94 | 94 | $this->parameterList[] = $objectType; |
| 95 | 95 | |
| 96 | 96 | return $this; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function byObjectId($objectId) |
| 107 | 107 | { |
| 108 | - $this->whereClause .=' AND objectid = ?'; |
|
| 108 | + $this->whereClause .= ' AND objectid = ?'; |
|
| 109 | 109 | $this->parameterList[] = $objectId; |
| 110 | 110 | |
| 111 | 111 | return $this; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function byIp($ipAddress) |
| 61 | 61 | { |
| 62 | - $this->whereClause .=' AND (ip LIKE ? OR forwardedip LIKE ?)'; |
|
| 62 | + $this->whereClause .= ' AND (ip LIKE ? OR forwardedip LIKE ?)'; |
|
| 63 | 63 | $this->parameterList[] = $ipAddress; |
| 64 | 64 | $this->parameterList[] = '%' . trim($ipAddress, '%') . '%'; |
| 65 | 65 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function byEmailAddress($emailAddress) |
| 77 | 77 | { |
| 78 | - $this->whereClause .=' AND email LIKE ?'; |
|
| 78 | + $this->whereClause .= ' AND email LIKE ?'; |
|
| 79 | 79 | $this->parameterList[] = $emailAddress; |
| 80 | 80 | |
| 81 | 81 | return $this; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function byName($name) |
| 92 | 92 | { |
| 93 | - $this->whereClause .=' AND name LIKE ?'; |
|
| 93 | + $this->whereClause .= ' AND name LIKE ?'; |
|
| 94 | 94 | $this->parameterList[] = $name; |
| 95 | 95 | |
| 96 | 96 | return $this; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function excludingRequest($requestId) |
| 107 | 107 | { |
| 108 | - $this->whereClause .=' AND id <> ?'; |
|
| 108 | + $this->whereClause .= ' AND id <> ?'; |
|
| 109 | 109 | $this->parameterList[] = $requestId; |
| 110 | 110 | |
| 111 | 111 | return $this; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function withConfirmedEmail() |
| 120 | 120 | { |
| 121 | - $this->whereClause .=' AND emailconfirm = ?'; |
|
| 121 | + $this->whereClause .= ' AND emailconfirm = ?'; |
|
| 122 | 122 | $this->parameterList[] = 'Confirmed'; |
| 123 | 123 | |
| 124 | 124 | return $this; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function excludingPurgedData(SiteConfiguration $configuration) |
| 135 | 135 | { |
| 136 | - $this->whereClause .=' AND ip <> ? AND email <> ?'; |
|
| 136 | + $this->whereClause .= ' AND ip <> ? AND email <> ?'; |
|
| 137 | 137 | $this->parameterList[] = $configuration->getDataClearIp(); |
| 138 | 138 | $this->parameterList[] = $configuration->getDataClearEmail(); |
| 139 | 139 | |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $offset = ($page - 1) * $limit; |
| 47 | 47 | |
| 48 | 48 | $logSearch = LogSearchHelper::get($database)->limit($limit, $offset); |
| 49 | - if($filterUser !== null){ |
|
| 49 | + if ($filterUser !== null) { |
|
| 50 | 50 | $logSearch->byUser(User::getByUsername($filterUser, $database)->getId()); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if($filterAction !== null){ |
|
| 53 | + if ($filterAction !== null) { |
|
| 54 | 54 | $logSearch->byAction($filterAction); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $offset = ($page - 1) * $limit; |
| 47 | 47 | |
| 48 | 48 | $logSearch = LogSearchHelper::get($database)->limit($limit, $offset); |
| 49 | - if($filterUser !== null){ |
|
| 49 | + if($filterUser !== null) { |
|
| 50 | 50 | $logSearch->byUser(User::getByUsername($filterUser, $database)->getId()); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if($filterAction !== null){ |
|
| 53 | + if($filterAction !== null) { |
|
| 54 | 54 | $logSearch->byAction($filterAction); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -125,7 +125,8 @@ |
||
| 125 | 125 | * @category Security-Critical |
| 126 | 126 | * @return SecurityConfiguration |
| 127 | 127 | */ |
| 128 | - public function asNone() { |
|
| 128 | + public function asNone() |
|
| 129 | + { |
|
| 129 | 130 | $config = new SecurityConfiguration(); |
| 130 | 131 | |
| 131 | 132 | return $config; |