Compare commits
6 Commits
01ce3c3090
...
build/envo
Author | SHA1 | Date | |
---|---|---|---|
1faf2ca7e1 | |||
e5314338bf | |||
29b573602a | |||
2e56de5d09 | |||
dc41ce62c4 | |||
9c31598f00 |
1
Makefile
1
Makefile
@ -1,7 +1,6 @@
|
|||||||
################################
|
################################
|
||||||
# Makefile
|
# Makefile
|
||||||
################################
|
################################
|
||||||
|
|
||||||
SOURCE=nineschool
|
SOURCE=nineschool
|
||||||
VERSION=1.0
|
VERSION=1.0
|
||||||
EOLE_VERSION=2.7
|
EOLE_VERSION=2.7
|
||||||
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
7
|
24
debian/control
vendored
Normal file
24
debian/control
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
Source: eole-nineschool
|
||||||
|
Section: web
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Equipe Envole <eole@ac-dijon.fr>
|
||||||
|
Build-Depends: debhelper (>= 7.0.50)
|
||||||
|
Standards-Version: 3.8.4
|
||||||
|
Homepage: http://eole.orion.education.fr/diff/
|
||||||
|
Vcs-Git: http://dev-eole.ac-dijon.fr/git/nineschool
|
||||||
|
Vcs-Browser: http://dev-eole.ac-dijon.fr/projects/nineschool/repository
|
||||||
|
|
||||||
|
Package: nineschool-sso
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}, eole-sso
|
||||||
|
Description: Filtre SSO pour nineschool "EOLE".
|
||||||
|
|
||||||
|
Package: eole-nineschool
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}, eole-envole-dependances, nineschool-sso
|
||||||
|
Description: Eolisation de l'application nineschool.
|
||||||
|
|
||||||
|
Package: nineschool-apps
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}, envole-dependances-apps
|
||||||
|
Description: Sources pour nineschool "EOLE".
|
44
debian/copyright
vendored
Normal file
44
debian/copyright
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
Format: http://dep.debian.net/deps/dep5
|
||||||
|
Upstream-Name: {PROJECT}
|
||||||
|
Source: {URL}
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: YEAR {UPSTREAM} {AUTHOR} <{MAIL}>
|
||||||
|
License: {UPSTREAM LICENSE}
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2012 Équipe EOLE <eole@ac-dijon.fr>
|
||||||
|
License: CeCILL-2
|
||||||
|
|
||||||
|
License: {UPSTREAM LICENSE}
|
||||||
|
{TEXT OF THE LICENSE}
|
||||||
|
|
||||||
|
License: CeCILL-2
|
||||||
|
This software is governed by the CeCILL-2 license under French law and
|
||||||
|
abiding by the rules of distribution of free software. You can use,
|
||||||
|
modify and or redistribute the software under the terms of the CeCILL-2
|
||||||
|
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||||
|
"http://www.cecill.info";.
|
||||||
|
.
|
||||||
|
As a counterpart to the access to the source code and rights to copy,
|
||||||
|
modify and redistribute granted by the license, users are provided only
|
||||||
|
with a limited warranty and the software's author, the holder of the
|
||||||
|
economic rights, and the successive licensors have only limited
|
||||||
|
liability.
|
||||||
|
.
|
||||||
|
In this respect, the user's attention is drawn to the risks associated
|
||||||
|
with loading, using, modifying and/or developing or reproducing the
|
||||||
|
software by the user in light of its specific status of free software,
|
||||||
|
that may mean that it is complicated to manipulate, and that also
|
||||||
|
therefore means that it is reserved for developers and experienced
|
||||||
|
professionals having in-depth computer knowledge. Users are therefore
|
||||||
|
encouraged to load and test the software's suitability as regards their
|
||||||
|
requirements in conditions enabling the security of their systems and/or
|
||||||
|
data to be ensured and, more generally, to use and operate it in the
|
||||||
|
same conditions as regards security.
|
||||||
|
.
|
||||||
|
The fact that you are presently reading this means that you have had
|
||||||
|
knowledge of the CeCILL-2 license and that you accept its terms.
|
||||||
|
.
|
||||||
|
On Eole systems, the complete text of the CeCILL-2 License can be found
|
||||||
|
in '/usr/share/common-licenses/CeCILL-2-en'.
|
1
debian/eole-nineschool.install
vendored
Normal file
1
debian/eole-nineschool.install
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
usr/share/eole
|
3
debian/gbp.conf
vendored
Normal file
3
debian/gbp.conf
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Set per distribution debian tag
|
||||||
|
[DEFAULT]
|
||||||
|
debian-tag = debian/envole/%(version)s
|
1
debian/nineschool-apps.install
vendored
Normal file
1
debian/nineschool-apps.install
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
var/www/html
|
1
debian/nineschool-sso.install
vendored
Normal file
1
debian/nineschool-sso.install
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
usr/share/sso
|
8
debian/rules
vendored
Executable file
8
debian/rules
vendored
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# -*- makefile -*-
|
||||||
|
|
||||||
|
# Uncomment this to turn on verbose mode.
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.0 (native)
|
@ -7,16 +7,21 @@ use Symfony\Component\Console\Input\InputArgument;
|
|||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Component\Routing\RouterInterface;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
|
|
||||||
|
|
||||||
use App\Entity\Group;
|
use App\Entity\Group as Group;
|
||||||
use App\Entity\User;
|
use App\Entity\User as User;
|
||||||
|
use App\Entity\Answer as Answer;
|
||||||
|
use App\Entity\Message as Message;
|
||||||
|
|
||||||
|
use App\Service\mailService;
|
||||||
|
|
||||||
class SynchroUsersCommand extends Command
|
class SynchroUsersCommand extends Command
|
||||||
{
|
{
|
||||||
private $container;
|
private $container;
|
||||||
|
private $router;
|
||||||
private $em;
|
private $em;
|
||||||
private $output;
|
private $output;
|
||||||
private $filesystem;
|
private $filesystem;
|
||||||
@ -24,12 +29,15 @@ class SynchroUsersCommand extends Command
|
|||||||
private $ldap;
|
private $ldap;
|
||||||
private $ldap_basedn;
|
private $ldap_basedn;
|
||||||
private $ldapgroups=[];
|
private $ldapgroups=[];
|
||||||
|
private $mail;
|
||||||
|
|
||||||
public function __construct(ContainerInterface $container,EntityManagerInterface $em)
|
public function __construct(ContainerInterface $container,EntityManagerInterface $em,RouterInterface $router, mailService $mail)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
|
$this->router = $router;
|
||||||
|
$this->mail = $mail;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configure()
|
protected function configure()
|
||||||
@ -587,6 +595,12 @@ class SynchroUsersCommand extends Command
|
|||||||
$this->em->persist($group);
|
$this->em->persist($group);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
|
// On s'assure que l'ensemble des activité active soit bien distribué en fonction
|
||||||
|
$activitys=$this->em->getRepository("App:Activity")->findAllGroupActivityActive($group,true);
|
||||||
|
foreach($activitys as $activity) {
|
||||||
|
$this->initAnswer($activity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->writeln('');
|
$this->writeln('');
|
||||||
@ -728,4 +742,48 @@ class SynchroUsersCommand extends Command
|
|||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function initAnswer($activity) {
|
||||||
|
$em = $this->em;
|
||||||
|
|
||||||
|
// Pour chaque élève
|
||||||
|
$group=$activity->getGroup();
|
||||||
|
foreach($group->getUsers() as $user) {
|
||||||
|
// Existe-t-il une réponse pour l'élève
|
||||||
|
if($user->hasRole("ROLE_USER")) {
|
||||||
|
$answer=$em->getRepository("App:Answer")->findOneBy(["user"=>$user,"activity"=>$activity]);
|
||||||
|
if(!$answer) {
|
||||||
|
$answer=new Answer;
|
||||||
|
$answer->setActivity($activity);
|
||||||
|
$answer->setUser($user);
|
||||||
|
$answer->setStatus(-1);
|
||||||
|
|
||||||
|
$em->persist($answer);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Message
|
||||||
|
$message=new Message;
|
||||||
|
$message->setMessage("Distribution de l'Activité");
|
||||||
|
$message->setDeletable(false);
|
||||||
|
$message->setUser($activity->getUser());
|
||||||
|
$message->setAnswer($answer);
|
||||||
|
$message->addReader($activity->getUser());
|
||||||
|
|
||||||
|
$em->persist($message);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Notification par mail de la distribution de l'activité
|
||||||
|
$to = $user->getEmail();
|
||||||
|
$from = $activity->getUser()->getEmail();
|
||||||
|
$subject="Nineschool : Nouvelle Activité à réaliser";
|
||||||
|
$body ="Activité = ".$activity->getName()."<br>";
|
||||||
|
$body.="Professeur = ".$activity->getUser()->getDisplayname()."<br>";
|
||||||
|
$body.="Matière = ".$activity->getSubject()."<br>";
|
||||||
|
$body.="Url = ".$this->router->generate('app_answer_update', ["id"=>$answer->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||||
|
|
||||||
|
$this->mail->sendEmail($subject, $body, $to, $from);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ class AnswerController extends AbstractController
|
|||||||
// Affichage du formulaire
|
// Affichage du formulaire
|
||||||
return $this->render($this->render.'edit.html.twig', [
|
return $this->render($this->render.'edit.html.twig', [
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usesidebar' => ($this->getUser()->hasRole("ROLE_ADMIN")),
|
'usesidebar' => false,
|
||||||
$this->data => $data,
|
$this->data => $data,
|
||||||
'mode' => 'update',
|
'mode' => 'update',
|
||||||
'form' => $form->createView()
|
'form' => $form->createView()
|
||||||
@ -227,7 +227,7 @@ class AnswerController extends AbstractController
|
|||||||
// Affichage du formulaire
|
// Affichage du formulaire
|
||||||
return $this->render($this->render.'view.html.twig', [
|
return $this->render($this->render.'view.html.twig', [
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usesidebar' => ($this->getUser()->hasRole("ROLE_ADMIN")),
|
'usesidebar' => false,
|
||||||
$this->data => $data,
|
$this->data => $data,
|
||||||
'mode' => 'update',
|
'mode' => 'update',
|
||||||
'form' => $form->createView()
|
'form' => $form->createView()
|
||||||
|
@ -239,7 +239,7 @@ class SecurityController extends AbstractController
|
|||||||
|
|
||||||
// Récupération des informations du user
|
// Récupération des informations du user
|
||||||
try{
|
try{
|
||||||
$response = \Unirest\Request::post($url.'/rest/user/'.$user->getUsername(),$headers,["key"=>$appmasterkey]);
|
$response = \Unirest\Request::post($url.'/rest/user/'.$user->getUsername(),$headers,["key"=>$appmasterkey,"only"=>"user,groups"]);
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {
|
catch (\Exception $e) {
|
||||||
die("Erreur de communication API = ".$e->getMessage()."\n");
|
die("Erreur de communication API = ".$e->getMessage()."\n");
|
||||||
|
@ -33,7 +33,7 @@ class ActivityType extends AbstractType
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
if($options["status"]==0) {
|
if($options["mode"]=="update"&&$options["status"]==0) {
|
||||||
$builder->add('distribution',
|
$builder->add('distribution',
|
||||||
SubmitType::class, [
|
SubmitType::class, [
|
||||||
"label" => "Distribuer",
|
"label" => "Distribuer",
|
||||||
|
2
src/nineschool-1.0/src/Migrations/.gitignore
vendored
2
src/nineschool-1.0/src/Migrations/.gitignore
vendored
@ -1 +1 @@
|
|||||||
*.php
|
*.php
|
@ -159,6 +159,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<br><br><br>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
{% block head_style %}
|
{% block encorelinktags %}
|
||||||
{{ encore_entry_link_tags('app') }}
|
|
||||||
{{ encore_entry_link_tags('dropzone') }}
|
{{ encore_entry_link_tags('dropzone') }}
|
||||||
{% endblock head_style %}
|
{% endblock encorelinktags %}
|
||||||
|
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
Reference in New Issue
Block a user