Compare commits

..

No commits in common. "da0f0ad0f34519aa3ac174dd815f844e6bf3ed8c" and "996651ca0e6b63b58adac17b48362251cb3bc4e9" have entirely different histories.

7 changed files with 15 additions and 51 deletions

View File

@ -104,7 +104,6 @@ class SecurityController extends Controller
$user->setAvatar("noavatar.png"); $user->setAvatar("noavatar.png");
$user->setVisible(true); $user->setVisible(true);
$user->setAuthlevel("simple"); $user->setAuthlevel("simple");
$user->setBelongingpopulation("agent");
$user->setRole("ROLE_USER"); $user->setRole("ROLE_USER");
if(in_array($username,$this->getParameter("ldap_usersadmin"))) if(in_array($username,$this->getParameter("ldap_usersadmin")))

View File

@ -49,7 +49,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"visibletrue"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"visibletrue"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = visibletrue"); $this->writelnred("== SCRIPT = visibletrue");
$this->visibletrue(); $this->visibletrue();
$script=new Script(); $script=new Script();
@ -61,7 +61,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setusersniveau"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setusersniveau"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = setusersniveau"); $this->writelnred("== SCRIPT = setusersniveau");
$this->setusersniveau(); $this->setusersniveau();
$script=new Script(); $script=new Script();
@ -73,7 +73,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setfgcancreateproject"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setfgcancreateproject"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = setfgcancreateproject"); $this->writelnred("== SCRIPT = setfgcancreateproject");
$this->setfgcancreateproject(); $this->setfgcancreateproject();
$script=new Script(); $script=new Script();
@ -85,7 +85,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createproject"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createproject"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = createproject"); $this->writelnred("== SCRIPT = createproject");
$this->createproject(); $this->createproject();
$script=new Script(); $script=new Script();
@ -97,7 +97,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createthumbmini"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createthumbmini"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = createthumbmini"); $this->writelnred("== SCRIPT = createthumbmini");
$this->createthumbmini(); $this->createthumbmini();
$script=new Script(); $script=new Script();
@ -109,7 +109,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createwidgetproject"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createwidgetproject"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = createwidgetproject"); $this->writelnred("== SCRIPT = createwidgetproject");
$this->createwidgetproject(); $this->createwidgetproject();
$script=new Script(); $script=new Script();
@ -121,7 +121,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"renamegroup"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"renamegroup"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = renamegroup"); $this->writelnred("== SCRIPT = renamegroup");
$this->renamegroup(); $this->renamegroup();
$script=new Script(); $script=new Script();
@ -134,7 +134,7 @@ class ScriptCommand extends Command
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"rolegroup"]); $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"rolegroup"]);
if(!$script) { if(!$script) {
$this->writeln("== SCRIPT = rolegroup"); $this->writelnred("== SCRIPT = rolegroup");
$this->rolegroup(); $this->rolegroup();
$script=new Script(); $script=new Script();
@ -144,18 +144,6 @@ class ScriptCommand extends Command
$this->writeln(""); $this->writeln("");
} }
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"userdefaultmissing"]);
if(!$script) {
$this->writeln("== SCRIPT = userdefaultmissing");
$this->userdefaultmissing();
$script=new Script();
$script->setName("userdefaultmissing");
$this->em->persist($script);
$this->em->flush();
$this->writeln("");
}
return 1; return 1;
} }
@ -331,28 +319,7 @@ class ScriptCommand extends Command
} }
} }
private function userdefaultmissing(){
$users = $this->em->getRepository('CadolesCoreBundle:User')->findAll();
foreach($users as $user) {
if($user->getVisible()=="") {
$user->setVisible(true);
$this->em->persist($user);
$this->em->flush();
}
if($user->getAuthlevel()=="") {
$user->setAuthlevel("simple");
$this->em->persist($user);
$this->em->flush();
}
if($user->getBelongingpopulation()=="") {
$user->setBelongingpopulation("agent");
$this->em->persist($user);
$this->em->flush();
}
}
}

View File

@ -85,8 +85,8 @@ class CoreController extends Controller
switch($key) { switch($key) {
case "firstname": if($user->getFirstname()=="") $toprofil=true; break; case "firstname": if($user->getFirstname()=="") $toprofil=true; break;
case "visible": if($user->getVisible()=="") $toprofil=true; break; case "visible": if($user->getVisible()=="") $toprofil=true; break;
//case "authlevel": if($user->getAuthlevel()=="") $toprofil=true; break; case "authlevel": if($user->getAuthlevel()=="") $toprofil=true; break;
//case "belongingpopulation": if($user->getBelongingpopulation()=="") $toprofil=true; break; case "belongingpopulation": if($user->getBelongingpopulation()=="") $toprofil=true; break;
case "job": if($user->getJob()=="") $toprofil=true; break; case "job": if($user->getJob()=="") $toprofil=true; break;
case "position": if($user->getPosition()=="") $toprofil=true; break; case "position": if($user->getPosition()=="") $toprofil=true; break;
case "niveau02": if($user->geNiveau02()=="") $toprofil=true; break; case "niveau02": if($user->geNiveau02()=="") $toprofil=true; break;

View File

@ -366,8 +366,8 @@ class UserController extends Controller
// Initialisation de l'enregistrement // Initialisation de l'enregistrement
$data = new User(); $data = new User();
$data->setVisible(true); $data->setVisible(true);
$data->setBelongingpopulation("authlevel");
$data->setAuthlevel("simple"); $data->setAuthlevel("simple");
$data->setBelongingpopulation("agent");
$fields=$this->getDefaultDatauser(); $fields=$this->getDefaultDatauser();
// Création du formulaire // Création du formulaire

View File

@ -81,7 +81,6 @@ class samlUserCreatorService implements UserCreatorInterface
$user->setAvatar("noavatar.png"); $user->setAvatar("noavatar.png");
$user->setVisible(true); $user->setVisible(true);
$user->setAuthlevel("simple"); $user->setAuthlevel("simple");
$user->setBelongingpopulation("agent");
$user->setRole("ROLE_USER"); $user->setRole("ROLE_USER");
// Création // Création

View File

@ -729,7 +729,6 @@ $api('$id',data);";
$user->setAvatar("noavatar.png"); $user->setAvatar("noavatar.png");
$user->setVisible(true); $user->setVisible(true);
$user->setAuthlevel("simple"); $user->setAuthlevel("simple");
$user->setBelongingpopulation("agent");
$user->setRole("ROLE_USER"); $user->setRole("ROLE_USER");
if(in_array($username,$this->getParameter("ldap_usersadmin"))) if(in_array($username,$this->getParameter("ldap_usersadmin")))

View File

@ -13,11 +13,11 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
%end if %end if
%if %%getVar("ninegate_syncldap", 'non') == "oui" %if %%getVar("ninegate_syncldap", 'non') == "oui"
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`visible`,`authlevel`,`belongingpopulation`) VALUES INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
(-100, -100, 'admin', 'Administrateur', '%%ninegate_organization', '', '%%system_mail_to', 'admin.jpg', 'ROLE_ADMIN', '%%ninegate_niveau01siren', 1, 'simple', 'agent'); (-100, -100, 'admin', 'Administrateur', '%%ninegate_organization', '', '%%system_mail_to', 'admin.jpg', 'ROLE_ADMIN', '%%ninegate_niveau01siren', 'simple');
%else %else
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`visible`,`authlevel`,`belongingpopulation`) VALUES INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
(-100, -100, 'admin', 'Administrateur', '%%libelle_etab', 'PWD_CAS', '%%system_mail_to', 'admin.jpg', 'ROLE_ADMIN', '%%numero_etab', 1, 'simple', 'agent'); (-100, -100, 'admin', 'Administrateur', '%%libelle_etab', 'PWD_CAS', '%%system_mail_to', 'admin.jpg', 'ROLE_ADMIN', '%%numero_etab', 'simple');
%end if %end if