diff options
author | friendica <info@friendica.com> | 2013-08-08 22:38:11 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-08-08 22:38:11 -0700 |
commit | 2dfd9dce058bf829c0bdeb54e473bca762c14311 (patch) | |
tree | bfe7ab9b383303bb3e512cbb105fa24c59d4c6c2 /mod | |
parent | 3fe5a1c6b68a87f2c40f7aeba5bd401183709ad2 (diff) | |
parent | ea6f5d429da097278bf65587b28e382b5e3e87be (diff) | |
download | volse-hubzilla-2dfd9dce058bf829c0bdeb54e473bca762c14311.tar.gz volse-hubzilla-2dfd9dce058bf829c0bdeb54e473bca762c14311.tar.bz2 volse-hubzilla-2dfd9dce058bf829c0bdeb54e473bca762c14311.zip |
Merge pull request #90 from beardy-unixer/master
Add access policy to admin panel.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/admin.php | 10 | ||||
-rw-r--r-- | mod/editwebpage.php | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/mod/admin.php b/mod/admin.php index f3e44afb8..7de133b38 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -217,6 +217,7 @@ function admin_page_site_post(&$a){ $register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0); + $access_policy = ((x($_POST,'access_policy')) ? intval(trim($_POST['access_policy'])) : 0); $abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0); $register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : ''); @@ -307,6 +308,7 @@ function admin_page_site_post(&$a){ set_config('system','maximagesize', $maximagesize); set_config('system','register_policy', $register_policy); + set_config('system','access_policy', $access_policy); set_config('system','account_abandon_days', $abandon_days); set_config('system','register_text', $register_text); set_config('system','allowed_sites', $allowed_sites); @@ -388,6 +390,13 @@ function admin_page_site(&$a) { REGISTER_OPEN => t("Open") ); + /* Acess policy */ + $access_choices = Array( + ACCESS_PRIVATE => t("Private"), + ACCESS_PAID => t("Paid Access"), + ACCESS_FREE => t("Free Access") + ); + $ssl_choices = array( SSL_POLICY_NONE => t("No SSL policy, links will track page SSL state"), SSL_POLICY_FULL => t("Force all links to use SSL") @@ -415,6 +424,7 @@ function admin_page_site(&$a) { '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Register policy"), get_config('system','register_policy'), "", $register_choices), + '$access_policy' => array('access_policy', t("Access policy"), get_config('system','access_policy'), "", $access_choices), '$register_text' => array('register_text', t("Register text"), htmlentities(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")), '$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')), '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")), diff --git a/mod/editwebpage.php b/mod/editwebpage.php index c7323a7f7..46c6b8817 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -9,11 +9,17 @@ function editwebpage_content(&$a) { $which = argv(1); // $a->get_channel() and stuff don't work here, so we've got to find the owner for ourselves. - $owner = q("select channel_id from channel where channel_address = '%s'", + $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which) ); + if($r) { + $owner = intval($r[0]['channel_id']); + //logger('owner: ' . print_r($owner,true)); + } + + if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; } |