This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 
<?php
defined('C5_EXECUTE') or die("Access Denied.");

class Concrete5_Controller_Dashboard_System_Registration_Profiles extends DashboardBaseController {

    public $helpers = array('form'); 
    
    public function __construct() { 
        $this->token = Loader::helper('validation/token');
        $html = Loader::helper('html');         

        $this->set('public_profiles',ENABLE_USER_PROFILES);
        $this->set('gravatar_fallback', Config::get('GRAVATAR_FALLBACK'));
        $this->set('gravatar_max_level', Config::get('GRAVATAR_MAX_LEVEL'));
        $this->set('gravatar_level_options', array('g' => 'G', 'pg' => 'PG', 'r' => 'R', 'x' => 'X'));
        $this->set('gravatar_image_set', Config::get('GRAVATAR_IMAGE_SET'));
        $this->set('gravatar_set_options', array('404' => '404', 'mm' => 'mm', 'identicon' => 'identicon', 'monsterid' => 'monsterid', 'wavatar' => "wavatar"));

    }

    public function update_profiles() { 
        if ($this->isPost()) {
            $publicProfilesEnabled = $this->post('public_profiles') ? true : false;
            Config::save('ENABLE_USER_PROFILES', $publicProfilesEnabled);
            if ($publicProfilesEnabled) {
                SinglePage::add('/members');
            }
            else {
                $membersPage = Page::getByPath('/members');
                if ($membersPage instanceof Page && !$membersPage->isError()) {
                    $membersPage->delete();
                }
            }
            Config::save('GRAVATAR_FALLBACK', ($this->post('gravatar_fallback')?true:false));
            Config::save('GRAVATAR_MAX_LEVEL', Loader::helper('security')->sanitizeString($this->post('gravatar_max_level')));
            Config::save('GRAVATAR_IMAGE_SET', Loader::helper('security')->sanitizeString($this->post('gravatar_image_set')));
            $message = ($this->post('public_profiles')?t('Public profiles have been enabled'):t('Public profiles have been disabled.'));
            $this->redirect('/dashboard/system/registration/profiles',$message);
        }
    }
    
    public function view($message = NULL) {
        if($message) {
            $this->set('message',$message);
        }
        $u = new User();
    }
}