Commit e7f21b2c authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Append Viewer SPA (#1661)

parent 71fc765d
......@@ -296,15 +296,14 @@ sub defaultValues {
'useRedirectOnError' => 1,
'useSafeJail' => 1,
'utotp2fActivation' => 0,
'viewerAllowDiff' => 1,
'viewerHiddenPK' => 'virtualHosts',
'webIDAuthnLevel' => 1,
'webIDExportedVars' => {},
'whatToTrace' => 'uid',
'yubikey2fActivation' => 0,
'yubikey2fPublicIDSize' => 12,
'yubikey2fSelfRegistration' => 0,
'yubikey2fUserCanRemoveKey' => 1
'viewerHiddenPK' => 'samlIDPMetaDataNodes samlSPMetaDataNodes',
'webIDAuthnLevel' => 1,
'webIDExportedVars' => {},
'whatToTrace' => 'uid',
'yubikey2fActivation' => 0,
'yubikey2fPublicIDSize' => 12,
'yubikey2fSelfRegistration' => 0,
'yubikey2fUserCanRemoveKey' => 1
};
}
......
......@@ -23,6 +23,7 @@ extends 'Lemonldap::NG::Common::Conf::AccessLib',
'Lemonldap::NG::Handler::PSGI::Router';
has csp => ( is => 'rw' );
has brw => ( is => 'rw', default => 0 );
## @method boolean init($args)
# Launch initialization method
......@@ -86,7 +87,7 @@ sub init {
$self->csp(
"default-src 'self' $portal;frame-ancestors 'none';form-action 'self';"
);
$self->brw( $conf->{viewerAllowBrowser} );
$self->defaultRoute( $working[0]->defaultRoute );
# Find out more glyphicones at https://www.w3schools.com/icons/bootstrap_icons_glyphicons.asp
......@@ -133,7 +134,8 @@ sub init {
}
sub tplParams {
return ( VERSION => $VERSION, ALLOWDIFF => 0 );
my ($self) = @_;
return ( VERSION => $VERSION, ALLOWBROWSER => $self->brw );
}
sub javascript {
......
......@@ -3558,12 +3558,12 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
],
'type' => 'select'
},
'viewerAllowDiff' => {
'default' => 1,
'viewerAllowBrowser' => {
'default' => 0,
'type' => 'bool'
},
'viewerHiddenPK' => {
'default' => 'virtualHosts',
'default' => 'samlIDPMetaDataNodes samlSPMetaDataNodes',
'type' => 'text'
},
'virtualHosts' => {
......
......@@ -918,14 +918,14 @@ sub attributes {
# Viewer
viewerHiddenPK => {
type => 'text',
default => 'virtualHosts',
default => 'samlIDPMetaDataNodes samlSPMetaDataNodes',
documentation => 'ConfTree hidden primary keys',
flags => 'm',
},
viewerAllowDiff => {
type => 'bool',
default => 1,
documentation => 'Allow configuration comparator',
viewerAllowBrowser => {
type => 'bool',
default => 0,
documentation => 'Allow configuration browser',
},
# Notification
......
......@@ -11,8 +11,8 @@ use utf8;
use Mouse;
use Lemonldap::NG::Common::Conf::Constants;
use Lemonldap::NG::Common::UserAgent;
use Crypt::OpenSSL::RSA;
use Convert::PEM;
#use Crypt::OpenSSL::RSA;
#use Convert::PEM;
use URI::URL;
use feature 'state';
......@@ -60,12 +60,11 @@ sub addRoutes {
)
# Other keys
->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] );
}
->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
sub prx {
my ( $self, $req, @others ) = @_;
$self->SUPER::prx( $req, @others );
# Difference between confs
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } )
->addRoute( 'diff.html', undef, ['GET'] );
}
sub getConfByNum {
......
......@@ -648,6 +648,7 @@
"radiusSecret":"سر مشترك",
"radiusServer":"اسم الخادم",
"randomPasswordRegexp":"التعبير النمطي لتوليد كلمة المرور",
"readOnlyMode":"Read-Only mode",
"redirectFormMethod":"طريقة إعادة توجيه الإستمارة",
"redirection":"معالج إعادة التوجيه",
"reference":"مرجع",
......@@ -819,6 +820,7 @@
"vhostPort":"المنفذ",
"vhostType":"نوع",
"view":"عرض",
"viewer":"Viewer",
"virtualHost":"المضيف الإفتراضى ",
"virtualHostName":"اسم المضيف الافتراضي",
"virtualHosts":"المضيفين الإفتراضيين",
......
......@@ -648,6 +648,7 @@
"radiusSecret":"Shared secret",
"radiusServer":"Server hostname",
"randomPasswordRegexp":"Regexp for password generation",
"readOnlyMode":"Read-Only mode",
"redirectFormMethod":"Method for redirect form",
"redirection":"Handler redirections",
"reference":"Reference",
......@@ -819,6 +820,7 @@
"vhostPort":"Port",
"vhostType":"Type",
"view":"View",
"viewer":"Viewer",
"virtualHost":"Virtual Host",
"virtualHostName":"Virtual host hostname",
"virtualHosts":"Virtual Hosts",
......
......@@ -648,6 +648,7 @@
"radiusSecret":"Shared secret",
"radiusServer":"Server hostname",
"randomPasswordRegexp":"Regexp for password generation",
"readOnlyMode":"Read-Only mode",
"redirectFormMethod":"Method for redirect form",
"redirection":"Handler redirections",
"reference":"Reference",
......@@ -819,6 +820,7 @@
"vhostPort":"Port",
"vhostType":"Type",
"view":"View",
"viewer":"Viewer",
"virtualHost":"Virtual Host",
"virtualHostName":"Virtual host hostname",
"virtualHosts":"Virtual Hosts",
......
......@@ -648,6 +648,7 @@
"radiusSecret":"Secret partagé",
"radiusServer":"Nom d'hôte du serveur",
"randomPasswordRegexp":"Expression regulière pour la génération des mots de passe",
"readOnlyMode":"Mode lecture seule",
"redirectFormMethod":"Méthode du formulaire de redirection",
"redirection":"Redirections du Handler",
"reference":"Référence",
......@@ -819,6 +820,7 @@
"vhostPort":"Port",
"vhostType":"Type",
"view":"Aperçu",
"viewer":"Explorateur",
"virtualHost":"Hôte virtuel",
"virtualHostName":"Nom de l'hôte virtuel",
"virtualHosts":"Hôtes virtuels",
......
......@@ -648,6 +648,7 @@
"radiusSecret":"Segreto condiviso",
"radiusServer":"Nome host del server",
"randomPasswordRegexp":"Regex per la generazione di password",
"readOnlyMode":"Read-Only mode",
"redirectFormMethod":"Metodo per il modulo di reindirizzamento",
"redirection":"Redirezioni del gestore",
"reference":"Riferimento",
......@@ -819,6 +820,7 @@
"vhostPort":"Porta",
"vhostType":"Typo",
"view":"Visualizzazione",
"viewer":"Viewer",
"virtualHost":"Virtual Host",
"virtualHostName":"Hostname di Virtual host",
"virtualHosts":"Virtual Hosts",
......
......@@ -648,6 +648,7 @@
"radiusSecret":"Bí mật đã được chia sẻ",
"radiusServer":"Máy chủ lưu trữ",
"randomPasswordRegexp":"Regexp để tạo mật khẩu",
"readOnlyMode":"Read-Only mode",
"redirectFormMethod":"Phương pháp chuyển hướng mẫu",
"redirection":"chuyển hướng trình điều khiển",
"reference":"Tham khảo",
......@@ -819,6 +820,7 @@
"vhostPort":"Port",
"vhostType":"Loại",
"view":"Khung nhìn",
"viewer":"Viewer",
"virtualHost":"Máy chủ ảo",
"virtualHostName":"Tên máy chủ lưu trữ ảo",
"virtualHosts":"Máy chủ ảo",
......
......@@ -648,6 +648,7 @@
"radiusSecret":"Shared secret",
"radiusServer":"Server hostname",
"randomPasswordRegexp":"Regexp for password generation",
"readOnlyMode":"Read-Only mode",
"redirectFormMethod":"Method for redirect form",
"redirection":"Handler redirections",
"reference":"Reference",
......@@ -819,6 +820,7 @@
"vhostPort":"Port",
"vhostType":"Type",
"view":"View",
"viewer":"Viewer",
"virtualHost":"Virtual Host",
"virtualHostName":"Virtual host hostname",
"virtualHosts":"Virtual Hosts",
......
......@@ -23,14 +23,7 @@
<ul class="nav navbar-nav">
<li><a class="link" ng-click="home()"><i class="glyphicon glyphicon-home"></i></a></li>
<!--
<li >
<input id="forcesave" type="checkbox" ng-model="forceSave" uib-tooltip="{{translate('forceSave')}}" tooltip-placement="right" ng-show="confirmNeeded||currentCfg.next" role="checkbox" aria-label="Force save">
</li>
-->
<TMPL_IF NAME="ALLOWDIFF">
<TMPL_IF NAME="ALLOWBROWSER">
<li uib-dropdown>
<a id="navmenu" name="menu" uib-dropdown-toggle data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="glyphicon glyphicon-cog"></i> {{translate('browse')}} <span class="caret"></span></a>
<ul uib-dropdown-menu aria-labelled-by="navmenu">
......@@ -39,13 +32,10 @@
<li><a class="link" ng-click="getCfg('latest')" title="Latest configuration"><i class="glyphicon glyphicon-refresh"></i> {{translate('latest')}}</a></li>
</ul>
</li>
</TMPL_IF>
<li><a class="link hidden-xs" ng-click="setShowHelp()"><i class="glyphicon" ng-class="{'glyphicon-eye-close': showH,'glyphicon-eye-open': !showH}" ></i> {{ translate((showH ? 'hideHelp' : 'showHelp')) }}</a></li>
<!--
<li ng-repeat="button in menu()" ng-include="'menubutton.html'"></li>
-->
<li uib-dropdown class="visible-xs">
<a id="langmenu" name="menu" uib-dropdown-toggle data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{translate('menu')}} <span class="caret"></span></a>
<ul uib-dropdown-menu aria-labelled-by="langmenu" role="grid">
......@@ -54,11 +44,9 @@
<li ng-include="'languages.html'"></li>
</ul>
</li>
<li>
<li>
<i class="glyphicon glyphicon-lock"></i>
<u>{{translate('You are on Read-Only mode')}}</u>
<u>{{translate('readOnlyMode')}}</u>
</li>
</ul>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment