Compare commits

...

3 Commits

10 changed files with 98 additions and 55 deletions

View File

@ -26,7 +26,6 @@
<variables>
<family name='Ninegate'>
<variable name="activer_eportail" type="oui/non" description="Activer ePortail" hidden='True' exists='False'><value>non</value></variable>
<variable name="activer_limesurvey" type="oui/non" description="Activer Limesurvey" hidden='True' exists='False'><value>non</value></variable>
<variable name="activer_moodle" type="oui/non" description="Activer Moodle" hidden='True' exists='False'><value>non</value></variable>
<variable name="activer_nextcloud" type="oui/non" description="Activer Nextcloud" hidden='True' exists='False'><value>non</value></variable>
@ -53,7 +52,6 @@
<variable type='string' name='ninegate_api_key' description="Clé d'accès API" mandatory='True'><value>APIKeyNinegate</value></variable>
<variable type='oui/non' name='ninegate_syncldap' description="Synchroniser Ninegate vers votre annuaire"><value>non</value></variable>
<variable type='oui/non' name='ninegate_synceportail' description="Synchroniser Ninegate vers ePortail"><value>non</value></variable>
<variable type='string' name='ninegate_ldaptemplate' description="Modèle d'annuaire"><value>scribe</value></variable>
<variable type='string' name='ninegate_pwdadmin' description="Mot de passe du compte admin durant l'instance (idem valeur Cadoles ldap)" mandatory='True'><value>cadoles</value></variable>
@ -223,11 +221,6 @@
<target type='variable'>activer_ninegate</target>
</condition>
<condition name='hidden_if_in' source='activer_eportail'>
<param>non</param>
<target type='variable'>ninegate_synceportail</target>
</condition>
<condition name='hidden_if_in' source='activer_ninegate'>
<param>non</param>
@ -237,7 +230,6 @@
<target type='variable'>ninegate_syncldap</target>
<target type='variable'>ninegate_synceportail</target>
<target type='variable'>ninegate_ldaptemplate</target>
<target type='variable'>ninegate_pwdadmin</target>
@ -295,7 +287,6 @@
<param>SSO</param>
<target type='variable'>ninegate_syncldap</target>
<target type='variable'>ninegate_synceportail</target>
<target type='variable'>ninegate_moderegistration</target>
<target type='variable'>ninegate_keyterm</target>
</condition>

View File

@ -155,7 +155,7 @@ ivory_ck_editor:
language: fr
toolbar: "my_toolbar_1"
uiColor: "#ffffff"
extraPlugins: ["html5video"]
extraPlugins: ["html5video","pastebase64"]
light_config:
language: fr
toolbar: "my_toolbar_2"

View File

@ -40,7 +40,7 @@
"symfony/symfony": "3.4.*",
"tetranz/select2entity-bundle": "2.*",
"thecsea/simple-caldav-client": "^0.1.10",
"mashape/unirest-php": "2.*",
"mashape/unirest-php": "3.*",
"twig/twig": "^1.0||^2.0"
},
"require-dev": {

View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "5c29a0c1698bd753d6b42df4822e5f2d",
"content-hash": "51482d6b9f9c27b385c17393182e0d82",
"hash": "e008822a96a469e24963e22d66f34c98",
"content-hash": "589f314a10ca56596cf580254885bd7c",
"packages": [
{
"name": "cboden/ratchet",
@ -2409,31 +2409,33 @@
},
{
"name": "mashape/unirest-php",
"version": "v2.6.6",
"version": "v3.0.4",
"source": {
"type": "git",
"url": "https://github.com/Mashape/unirest-php.git",
"reference": "73c2d903232bb5a125396e606b67314a87b8b21c"
"reference": "842c0f242dfaaf85f16b72e217bf7f7c19ab12cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Mashape/unirest-php/zipball/73c2d903232bb5a125396e606b67314a87b8b21c",
"reference": "73c2d903232bb5a125396e606b67314a87b8b21c",
"url": "https://api.github.com/repos/Mashape/unirest-php/zipball/842c0f242dfaaf85f16b72e217bf7f7c19ab12cb",
"reference": "842c0f242dfaaf85f16b72e217bf7f7c19ab12cb",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-json": "*",
"php": ">=5.4.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "0.1.*",
"phpunit/phpunit": "~4.4"
},
"suggest": {
"ext-json": "Allows using JSON Bodies for sending and parsing requests"
},
"type": "library",
"autoload": {
"psr-0": {
"Unirest": "src"
"Unirest\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -2449,7 +2451,7 @@
"https",
"rest"
],
"time": "2016-02-16 16:45:52"
"time": "2016-08-11 17:49:21"
},
{
"name": "monolog/monolog",

View File

@ -8,6 +8,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpFoundation\Response;
use Doctrine\DBAL\Connection as DBALConnection;
use Doctrine\ORM\EntityManager;
@ -24,6 +25,7 @@ use Unirest\Request;
global $bdd01;
global $config;
class OnlyCommand extends Command
{
private $container;
@ -83,26 +85,21 @@ class OnlyCommand extends Command
$this->only_sync = true;
$this->only_url = "https://transnum.oo.pp.ac-dijon.fr"."/api/2.0/";
$this->only_url = "https://transnum.oo.ac-dijon.fr"."/api/2.0/";
$this->only_user = "admin";
$this->only_password = "brigitte89!";
$im = new \Imagick();
$im->setResolution(350, 350);
$im->readImage("/var/www/html/ninegate/uploads/file/widget-308/essai.csv[0]");
$im->setImageBackgroundColor('#ffffff');
$im = $im->flattenImages();
$im->setImageFormat('jpeg');
$im->writeImage("/var/www/html/ninegate/uploads/file/widget-308/toto.jpg");
return 1;
if($this->only_sync) {
//$client= new curl();
// Only Office est-il dans le domaine
if(stripos($this->only_url,"/")===0)
$this->only_url="https://".$this->container->getParameter("weburl").$this->only_url;
$indomaine = (stripos($this->only_url,$this->container->getParameter("weburl"))!==false);
// Si hors domaine on utilise le proxy si proxy il y a
if(!$indomaine) {
$PROXYactivate = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue();
if($PROXYactivate) {
@ -112,17 +109,65 @@ class OnlyCommand extends Command
}
}
// Récupération des informations utilisateurs issus du masteridentity
$headers = ['Accept' => 'application/json'];
// Authentification à onlyoffice
$this->writeln('');
$this->writeln('== AUTHENTIFICATION =================================');
\Unirest\Request::verifyPeer(false);
\Unirest\Request::verifyHost(false);
$headers = ['Host' => 'transnum.oo.ac-dijon.fr', 'Accept' => 'application/json','Content-Type'=>'application/json'];
$query = array('userName' => $this->only_user, 'password' => $this->only_password);
$body = json_encode($query);
$body = \Unirest\Request\Body::json($query);
$response = \Unirest\Request::post($this->only_url.'/authentication',$headers,$body);
if($this->koresponse($response)) return 0;
$token=$response->body->response->token;
$headers["Authorization"]=$token;
// Synchronisation des utilisateur Only sur l'annuaire
$this->writeln('');
$this->writeln('== SYNCHRONISATION ONLY==============================');
//$response = \Unirest\Request::get($this->only_url.'/settings/ldap/sync',$headers);
//if($this->koresponse($response)) return 0;
// Controler les utilisateur only
$this->writeln('');
$this->writeln('== CONTROLE USER ONLY================================');
$response = \Unirest\Request::get($this->only_url.'/people',$headers);
if($this->koresponse($response)) return 0;
foreach($response->body->response as $onlyuser) {
$user=$this->em->getRepository("CadolesCoreBundle:User")->findBy(["username"=>$onlyuser->userName]);
if(!$user) {
$this->writelnred("ERREUR ".$onlyuser->userName." existe dans OnlyOffice mais pas dans Ninegate");
}
}
// Controler les utilisateurs ninegate
$this->writeln('');
$this->writeln('== CONTROLE USER NINEGATE============================');
$users=$this->em->getRepository("CadolesCoreBundle:User")->findAll();
foreach($users as $user) {
$response = \Unirest\Request::get($this->only_url.'/people/'.$user->getUsername(),$headers);
if($this->koresponse($response)) {
$this->writelnred("ERREUR ".$user->getUsername()." existe dans Ninegate mais pas dans OnlyOffice");
}
}
}
$this->writeln('');
return 1;
}
function koresponse($response) {
if($response->code>=Response::HTTP_BAD_REQUEST) {
$this->writelnred("ERREUR ".$response->code);
if(property_exists($response,"body") && property_exists($response->body,"error")) $this->writelnred("ERREUR ".$response->body->error->message);;
return true;
}
return false;
}
private function writelnred($string) {
$this->output->writeln('<fg=red>'.$string.'</>');
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");

View File

@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
(-100, 'Interne', 'SIREN');
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}oIZgb8jC4L72wg4rgK+xfzdfPiy2Z8BA
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}lq8Ffm9MG+azcCnLde4qj0KU0j3XFO8/
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');

View File

@ -702,8 +702,8 @@ class InitDataCommand extends ContainerAwareCommand
$entityWidget->setDescription("Conversation instantanée");
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_chat");
$entityWidget->setHeight("1000");
$entityWidget->setAutoajust(false);
$entityWidget->setBorder(true);
$entityWidget->setAutoajust(true);
$entityWidget->setBorder(false);
$entityWidget->setOpened(true);
$entityWidget->setAccess(["config","user","group"]);
$parameter = json_decode('{"fields": []}');
@ -869,37 +869,37 @@ class InitDataCommand extends ContainerAwareCommand
$entityPage->setId(-110);
$entityPage->setRowOrder(0);
$entityPage->setName('Accueil Groupe');
$entityPage->setParentfor('Groupe');
$entityPage->setMaxwidth(1500);
$entityPage->setParentfor('group');
$entityPage->setMaxwidth(0);
$entityPage->setPagecategory($entityPagecategory);
$entityPage->setTemplate('{"rows":[{"id":0,"cols":[{"id":0,"size": 4,"rows":[]},{"id":1,"size": 8,"rows":[{"id":0,"cols":[{"id":0,"size": 12}]},{"id":1,"cols":[{"id":0,"size": 6},{"id":1,"size": 6}]}]}]}]}');
$entityPage->setTemplate('{"rows":[{"id":0,"cols":[{"id":0,"size": 3,"rows":[]},{"id":1,"size": 6,"rows":[{"id":0,"cols":[{"id":0,"size": 6},{"id":1,"size": 6}]}]},{"id":2,"size": 3,"rows":[]}]}]}');
$em->persist($entityPage);
$em->flush();
// Widget Nos Liens
$fields=["fields"=>[["id"=>"modedesktop","value"=>2]]];
$this->addWidget(-120,$entityPage,-1960,"R1C1",1,"Nos Liens",true,$fields);
$this->addWidget(-120,$entityPage,-1960,"R1C2R1C1",0,"Nos Liens",true,$fields);
// Widget Nos Fichiers
$fields=["fields"=>[]];
$this->addWidget(-130,$entityPage,-1920,"R1C1",2,"Nos Fichiers",true,$fields);
$this->addWidget(-130,$entityPage,-1920,"R1C2R1C2",0,"Nos Fichiers",true,$fields);
// Widget Info Page
$fields=["fields"=>[]];
$this->addWidget(-140,$entityPage,-1860,"R1C1",3,"Information Page",true,$fields);
$this->addWidget(-140,$entityPage,-1860,"R1C1",0,"Information Page",true,$fields);
// Widget Notre Blog
$fields=["fields"=>[["id"=>"nbarticle","value"=>5]]];
$this->addWidget(-150,$entityPage,-1890,"R1C2R1C1",1,"Notre Blog",false,$fields);
$this->addWidget(-150,$entityPage,-1890,"R1C2",0,"Notre Blog",false,$fields);
// Widget Notre Calendrier
$fields=["fields"=>[["id"=>"nbday","value"=>30]]];
$this->addWidget(-160,$entityPage,-1900,"R1C2R2C1",1,"Notre Calendrier",true,$fields);
$this->addWidget(-160,$entityPage,-1900,"R1C2R1C1",1,"Notre Calendrier",true,$fields);
// Chat
$fields=["fields"=>[]];
$this->addWidget(-170,$entityPage,-1840,"R1C2R2C2",1,"Chat",true,$fields);
$this->addWidget(-170,$entityPage,-1840,"R1C3",0,"Chat",false,$fields);
}
$output->writeln('');

View File

@ -243,6 +243,7 @@ class PagetemplateController extends Controller
}
// Retour
dump("retdirect to".$this->generateUrl($this->routeprimary));
return $this->redirect($this->generateUrl($this->routeprimary));
}

View File

@ -3,18 +3,22 @@
{% block localstyle %}
{% if framed %}
{% if border %}
#page-wrapper:last-of-type {
//padding: 5px 25px 10px 15px;
//background: transparent;
#topchat {
margin: 5px -15px 5px -25px;
}
.mychat{
margin: 0px 0px 0px -10px;
}
{% else %}
#page-wrapper {
padding: 5px 25px 0px 15px;
//background: transparent;
#topchat {
margin: 5px -30px;
}
.mychat{
margin: 0px -15px;
}
{% endif %}
{% else %}
#page-wrapper { padding-top:20px; padding-bottom:30px; }
#topchat { padding-top:20px; padding-bottom:30px; }
{% endif %}
.message {
@ -57,7 +61,7 @@
{% block pagewrapper %}
{% if app.user and ingroup %}
{{ form_start(form) }}
<div class='row'>
<div id="topchat" class='row'>
{{ form_widget(form.message) }}
<input id="sendbymail" type="checkbox" id="item_essential" name="item[essential]" style="float:right" class='switch' ></input>
<label class="custom-control-label" for="sendbymail">Envoyer par Mail ?</label>

View File

@ -4,7 +4,7 @@ parameters:
# Si SQL cela veut dire que c'est l'applicatif qui gère les utilisateurs
# Sinon la source est externe soit via un annuaire soit via des attributs venant d'un SSO
# Si la source est externe de fait pas de module d'inscription ni de reset de password
# Et pas de synchronisation vers un annuaire ou vers ePortail
# Et pas de synchronisation vers un annuaire
masteridentity: %%ninegate_masteridentity
# Mode d'authentification soit SQL / LDAP / CAS / SAML