2012-03-02 18:27:10 +01:00
|
|
|
<?php
|
|
|
|
class CMSProfileController extends LeftAndMain {
|
|
|
|
|
|
|
|
static $url_segment = 'myprofile';
|
2012-11-06 23:41:48 +01:00
|
|
|
|
|
|
|
static $menu_title = 'My Profile';
|
|
|
|
|
2012-03-05 16:07:20 +01:00
|
|
|
static $required_permission_codes = false;
|
2012-03-02 18:27:10 +01:00
|
|
|
|
|
|
|
public function index($request) {
|
|
|
|
$form = $this->Member_ProfileForm();
|
|
|
|
return $this->customise(array(
|
|
|
|
'Content' => ' ',
|
|
|
|
'Form' => $form
|
|
|
|
))->renderWith('CMSDialog');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function Member_ProfileForm() {
|
|
|
|
return new Member_ProfileForm($this, 'Member_ProfileForm', Member::currentUser());
|
|
|
|
}
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function canView($member = null) {
|
2012-03-02 18:27:10 +01:00
|
|
|
if(!$member && $member !== FALSE) $member = Member::currentUser();
|
|
|
|
|
|
|
|
// cms menus only for logged-in members
|
|
|
|
if(!$member) return false;
|
|
|
|
|
|
|
|
// Only check for generic CMS permissions
|
|
|
|
if(
|
|
|
|
!Permission::checkMember($member, "CMS_ACCESS_LeftAndMain")
|
|
|
|
&& !Permission::checkMember($member, "CMS_ACCESS_CMSMain")
|
|
|
|
) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|