2011-01-24 03:09:16 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Facebook, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
abstract class PhabricatorPeopleController extends PhabricatorController {
|
|
|
|
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
2011-01-26 22:21:12 +01:00
|
|
|
$page = $this->buildStandardPageView();
|
2011-01-24 03:09:16 +01:00
|
|
|
|
|
|
|
$page->setApplicationName('People');
|
|
|
|
$page->setBaseURI('/people/');
|
|
|
|
$page->setTitle(idx($data, 'title'));
|
Provide an activity log for login and administrative actions
Summary: This isn't complete, but I figured I'd ship it for review while it's still smallish.
Provide an activity log for high-level system actions (logins, admin actions). This basically allows two things to happen:
- The log itself is useful if there are shenanigans.
- Password login can check it and start CAPTCHA'ing users after a few failed attempts.
I'm going to change how the admin stuff works a little bit too, since right now you can make someone an agent, grab their certificate, revert them back to a normal user, and then act on their behalf over Conduit. This is a little silly, I'm going to move "agent" to the create workflow instead. I'll also add a confirm/email step to the administrative password reset flow.
Test Plan: Took various administrative and non-administrative actions, they appeared in the logs. Filtered the logs in a bunch of different ways.
Reviewers: jungejason, tuomaspelkonen, aran
CC:
Differential Revision: 302
2011-05-18 03:42:21 +02:00
|
|
|
|
|
|
|
$tabs = array(
|
|
|
|
'directory' => array(
|
|
|
|
'name' => 'User Directory',
|
|
|
|
'href' => '/people/',
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
if ($this->getRequest()->getUser()->getIsAdmin()) {
|
|
|
|
$tabs = array_merge(
|
|
|
|
$tabs,
|
|
|
|
array(
|
|
|
|
'logs' => array(
|
|
|
|
'name' => 'Activity Logs',
|
|
|
|
'href' => '/people/logs/',
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
$page->setTabs($tabs, idx($data, 'tab'));
|
|
|
|
|
2011-02-08 05:56:05 +01:00
|
|
|
$page->setGlyph("\xE2\x99\x9F");
|
2011-01-24 03:09:16 +01:00
|
|
|
$page->appendChild($view);
|
|
|
|
|
|
|
|
$response = new AphrontWebpageResponse();
|
|
|
|
return $response->setContent($page->render());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|