Ref conf must be latest (Closes: #889)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 10 years ago
parent 147845db38
commit d0da5e3ea0
  1. 13
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf.pm
  2. 2
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm
  3. 2
      lemonldap-ng-manager/site/static/forms/home.html
  4. 2
      lemonldap-ng-manager/site/templates/manager.tpl

@ -844,13 +844,18 @@ sub newConf {
return $self->sendError( $req, "Missing configuration number", 400 ); return $self->sendError( $req, "Missing configuration number", 400 );
} }
# Configuration must be compared to latest
my $cfgNum = $self->confAcc->lastCfg;
if ($Lemonldap::NG::Common::Conf::msg) {
$req->error($Lemonldap::NG::Common::Conf::msg);
return undef;
}
# Set current conf to cfgNum # Set current conf to cfgNum
unless ( defined $self->getConfByNum( $req->params('cfgNum') ) ) { unless ( defined $self->getConfByNum($cfgNum) ) {
return $self->sendError( return $self->sendError(
$req, $req,
"Configuration " "Configuration $cfgNum not available "
. $req->params('cfgNum')
. " not available "
. $Lemonldap::NG::Common::Conf::msg, . $Lemonldap::NG::Common::Conf::msg,
400 400
); );

@ -119,7 +119,7 @@ sub scanTree {
# Set cfgNum to ref cfgNum (will be changed when saving), set other # Set cfgNum to ref cfgNum (will be changed when saving), set other
# metadatas and set a value to the key if empty # metadatas and set a value to the key if empty
$self->newConf->{cfgNum} = $self->refConf->{cfgNum}; $self->newConf->{cfgNum} = $self->req->params('cfgNum');
$self->newConf->{cfgAuthor} = $self->req->userData->{_whatToTrace} $self->newConf->{cfgAuthor} = $self->req->userData->{_whatToTrace}
// "anonymous"; // "anonymous";
$self->newConf->{cfgAuthorIP} = $self->req->remote_ip; $self->newConf->{cfgAuthorIP} = $self->req->remote_ip;

@ -26,7 +26,7 @@
</tr> </tr>
<tr ng-if="currentCfg.cfgLog"> <tr ng-if="currentCfg.cfgLog">
<th><span trspan="cfgLog" /></th> <th><span trspan="cfgLog" /></th>
<td>{{currentCfg.cfgLog}}</td> <td id="cfglog">{{currentCfg.cfgLog}}</td>
</tr> </tr>
</table> </table>
</div> </div>

@ -21,7 +21,7 @@
<div class="navbar navbar-default" ng-class="{'hidden-xs':!showM}"> <div class="navbar navbar-default" ng-class="{'hidden-xs':!showM}">
<div class="navbar-collapse" ng-class="{'collapse':!showM}" id="formmenu"> <div class="navbar-collapse" ng-class="{'collapse':!showM}" id="formmenu">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li><a id="save" class="link" ng-click="save()" tabIndex="-1"><i class="glyphicon glyphicon-save"></i> {{translate('save')}}<input type="checkbox" ng-model="forceSave" title="{{translate('forceSave')}}" ng-show="confirmNeeded"></a></li> <li><a id="save" class="link" ng-click="save()" tabIndex="-1"><i class="glyphicon glyphicon-save"></i> {{translate('save')}}<input id="forcesave" type="checkbox" ng-model="forceSave" title="{{translate('forceSave')}}" ng-show="confirmNeeded"></a></li>
<li ng-class="{'disabled':!currentCfg.prev}"><a class="link" ng-click="currentCfg.prev && getCfg(currentCfg.prev)" title="Configuration {{currentCfg.prev}}"><i class="glyphicon glyphicon-arrow-left"></i> {{translate('previous')}}</a></li> <li ng-class="{'disabled':!currentCfg.prev}"><a class="link" ng-click="currentCfg.prev && getCfg(currentCfg.prev)" title="Configuration {{currentCfg.prev}}"><i class="glyphicon glyphicon-arrow-left"></i> {{translate('previous')}}</a></li>
<li ng-class="{'disabled':!currentCfg.next}"><a class="link" ng-click="currentCfg.next && getCfg(currentCfg.next)" title="Configuration {{currentCfg.next}}"><i class="glyphicon glyphicon-arrow-right"></i> {{translate('next')}}</a></a></li> <li ng-class="{'disabled':!currentCfg.next}"><a class="link" ng-click="currentCfg.next && getCfg(currentCfg.next)" title="Configuration {{currentCfg.next}}"><i class="glyphicon glyphicon-arrow-right"></i> {{translate('next')}}</a></a></li>
<li><a class="link" ng-click="getCfg('latest')" title="Latest configuration"><i class="glyphicon glyphicon-refresh"></i> {{translate('latest')}}</a></li> <li><a class="link" ng-click="getCfg('latest')" title="Latest configuration"><i class="glyphicon glyphicon-refresh"></i> {{translate('latest')}}</a></li>

Loading…
Cancel
Save