]> git.mxchange.org Git - friendica.git/commitdiff
add multi vs. single user config to the admin panel
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 17 Feb 2013 16:42:32 +0000 (17:42 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 17 Feb 2013 16:42:32 +0000 (17:42 +0100)
mod/admin.php
view/admin_site.tpl
view/smarty3/admin_site.tpl

index 6e18ec5c863004ccebf85be88aa8dcf56c18d3d2..9400a28e04aa4041cbeb2e2d1541e74b5cddc16e 100644 (file)
@@ -281,6 +281,7 @@ function admin_page_site_post(&$a){
        $lockpath               =       ((x($_POST,'lockpath'))                 ? notags(trim($_POST['lockpath']))              : '');
        $temppath               =       ((x($_POST,'temppath'))                 ? notags(trim($_POST['temppath']))              : '');
        $basepath               =       ((x($_POST,'basepath'))                 ? notags(trim($_POST['basepath']))              : '');
+       $singleuser             =       ((x($_POST,'singleuser'))               ? notags(trim($_POST['singleuser']))            : '');
 
        if($ssl_policy != intval(get_config('system','ssl_policy'))) {
                if($ssl_policy == SSL_POLICY_FULL) {
@@ -342,7 +343,12 @@ function admin_page_site_post(&$a){
                del_config('system','mobile-theme');
        } else {
                set_config('system','mobile-theme', $theme_mobile);
-       }
+        }
+        if ( $singleuser === '---' ) {
+            del_config('system','singleuser');
+        } else {
+            set_config('system','singleuser', $singleuser);
+        }
        set_config('system','maximagesize', $maximagesize);
        set_config('system','max_image_length', $maximagelength);
        set_config('system','jpeg_quality', $jpegimagequality);
@@ -428,12 +434,19 @@ function admin_page_site(&$a) {
             if (file_exists($file . '/mobile')) {
                 $theme_choices_mobile[$f] = $theme_name;
             }
-                       else {
+               else {
                 $theme_choices[$f] = $theme_name;
                        }
                }
        }
-       
+
+        /* get user names to make the install a personal install of X */
+        $user_names = array();
+        $user_names['---'] = t('Multi user instance');
+        $users = q("SELECT username, nickname FROM `user`");
+        foreach ($users as $user) {
+            $user_names[$user['nickname']] = $user['username'];
+        }
        
        /* Banner */
        $banner = get_config('system','banner');
@@ -477,6 +490,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),
                '$new_share'            => array('new_share', t("'Share' element"), get_config('system','new_share'), t("Activates the bbcode element 'share' for repeating items.")),
                '$hide_help'            => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")),
+               '$singleuser'           => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names),
                '$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.")),
                '$maximagelength'               => array('maximagelength', t("Maximum image length"), get_config('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")),
                '$jpegimagequality'             => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")),
index 1a2a83339b6f53a5f63b941e07df27cc092cd37e..a6fe2d789cbbc0126be00154c81fb02c4324c001 100644 (file)
@@ -52,6 +52,7 @@
        {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }}
        {{ inc field_checkbox.tpl with $field=$new_share }}{{ endinc }}
        {{ inc field_checkbox.tpl with $field=$hide_help }}{{ endinc }}
+       {{ inc field_select.tpl with $field=$singleuser }}{{ endinc }}
 
        
        <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
index af78ca734bf95d62368c58e91fd6f813a9e91a25..bad0f52756e4c39945cbdd93099e5e3492ec8da9 100644 (file)
        {{include file="field_input.tpl" field=$sitename}}
        {{include file="field_textarea.tpl" field=$banner}}
        {{include file="field_select.tpl" field=$language}}
-       {{include file="field_select.tpl" field=$theme}}
+        {{include file="field_select.tpl" field=$theme}}
        {{include file="field_select.tpl" field=$theme_mobile}}
        {{include file="field_select.tpl" field=$ssl_policy}}
        {{include file="field_checkbox.tpl" field=$new_share}}
        {{include file="field_checkbox.tpl" field=$hide_help}}
+        {{include file="field_select.tpl" field=$singleuser}}
 
        
        <div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>