Commit 6c1afc90468ca21a55bd3a6d78dafc30c98d11cb
Exists in
master
Merge branch '3.1' of https://github.com/lightbase/cacic
Showing
28 changed files
with
2067 additions
and
300 deletions
Show diff stats
app/Resources/views/base.html.twig
@@ -27,6 +27,13 @@ | @@ -27,6 +27,13 @@ | ||
27 | {% endstylesheets %} | 27 | {% endstylesheets %} |
28 | 28 | ||
29 | <link href="{{ asset('bundles/caciccommon/libs/googleapis.fonts.css') }}" rel="stylesheet"> | 29 | <link href="{{ asset('bundles/caciccommon/libs/googleapis.fonts.css') }}" rel="stylesheet"> |
30 | + | ||
31 | + <!-- javascript | ||
32 | + ================================================== --> | ||
33 | + <!-- Placed at the top of the document so thinks work --> | ||
34 | + <!-- jQuery (UI) --> | ||
35 | + <script type="text/javascript" src="{{ asset('bundles/caciccommon/libs/jquery.1.7.1.min.js') }}"></script> | ||
36 | + <script type="text/javascript" src="{{ asset('bundles/caciccommon/libs/jquery-ui-1.8.17.min.js') }}"></script> | ||
30 | 37 | ||
31 | {% endblock %} | 38 | {% endblock %} |
32 | 39 | ||
@@ -164,13 +171,6 @@ | @@ -164,13 +171,6 @@ | ||
164 | </div><!--/.fluid-container--> | 171 | </div><!--/.fluid-container--> |
165 | 172 | ||
166 | {% block javascripts %} | 173 | {% block javascripts %} |
167 | - | ||
168 | - <!-- javascript | ||
169 | - ================================================== --> | ||
170 | - <!-- Placed at the end of the document so the pages load faster --> | ||
171 | - <!-- jQuery (UI) --> | ||
172 | - <script type="text/javascript" src="{{ asset('bundles/caciccommon/libs/jquery.1.7.1.min.js') }}"></script> | ||
173 | - <script type="text/javascript" src="{{ asset('bundles/caciccommon/libs/jquery-ui-1.8.17.min.js') }}"></script> | ||
174 | 174 | ||
175 | 175 | ||
176 | {% javascripts output='assets/base.js' combine=true | 176 | {% javascripts output='assets/base.js' combine=true |
app/config/config.yml
@@ -153,14 +153,35 @@ knp_paginator: | @@ -153,14 +153,35 @@ knp_paginator: | ||
153 | 153 | ||
154 | # Configuration for FMElFinderBundle | 154 | # Configuration for FMElFinderBundle |
155 | fm_elfinder: | 155 | fm_elfinder: |
156 | - locale: %locale% | ||
157 | - editor: simple | ||
158 | - compression: false | ||
159 | - connector: | ||
160 | - roots: | ||
161 | - downloads: | ||
162 | - driver: elfinder.driver.filesystem | ||
163 | - path: downloads | 156 | + instances: |
157 | + default: | ||
158 | + locale: %locale% # defaults to current request locale | ||
159 | + editor: simple # other choices are tinymce or simple, and form | ||
160 | + compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression | ||
161 | + connector: | ||
162 | + roots: # at least one root must be defined | ||
163 | + uploads: | ||
164 | + showhidden: false # defaults to false | ||
165 | + driver: LocalFileSystem | ||
166 | + path: downloads | ||
167 | + upload_max_size: 2M | ||
168 | + upload_deny: ['all'] | ||
169 | + form: | ||
170 | + locale: %locale% # defaults to current request locale | ||
171 | + editor: form # other choices are tinymce or simple, and form | ||
172 | + compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression | ||
173 | + connector: | ||
174 | + roots: # at least one root must be defined | ||
175 | + cacic: | ||
176 | + showhidden: false # defaults to false | ||
177 | + driver: LocalFileSystem | ||
178 | + path: downloads/cacic | ||
179 | + upload_deny: ['all'] | ||
180 | + outros: | ||
181 | + showhidden: false # defaults to false | ||
182 | + driver: LocalFileSystem | ||
183 | + path: downloads/outros | ||
184 | + upload_deny: ['all'] | ||
164 | 185 | ||
165 | jms_translation: | 186 | jms_translation: |
166 | configs: | 187 | configs: |
@@ -215,5 +236,4 @@ services: | @@ -215,5 +236,4 @@ services: | ||
215 | 236 | ||
216 | apikey_authenticator: | 237 | apikey_authenticator: |
217 | class: Cacic\WSBundle\Security\ApiKeyAuthenticator | 238 | class: Cacic\WSBundle\Security\ApiKeyAuthenticator |
218 | - arguments: ["@webservice_user_provider"] | ||
219 | - | 239 | + arguments: ["@webservice_user_provider"] |
220 | \ No newline at end of file | 240 | \ No newline at end of file |
app/config/config_test.yml
@@ -23,4 +23,10 @@ web_profiler: | @@ -23,4 +23,10 @@ web_profiler: | ||
23 | intercept_redirects: false | 23 | intercept_redirects: false |
24 | 24 | ||
25 | swiftmailer: | 25 | swiftmailer: |
26 | - disable_delivery: true | ||
27 | \ No newline at end of file | 26 | \ No newline at end of file |
27 | + disable_delivery: true | ||
28 | + | ||
29 | +# Adiciona autenticação HTTP para as requisições de teste | ||
30 | +security: | ||
31 | + firewalls: | ||
32 | + main: | ||
33 | + http_basic: ~ | ||
28 | \ No newline at end of file | 34 | \ No newline at end of file |
app/config/security.yml
@@ -60,6 +60,8 @@ security: | @@ -60,6 +60,8 @@ security: | ||
60 | - { path: ^/cocar/api, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 60 | - { path: ^/cocar/api, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
61 | - { path: ^/ws, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 61 | - { path: ^/ws, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
62 | - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 62 | - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
63 | - - { path: ^/, roles: ROLE_ADMIN } | ||
64 | - - { path: ^/efconnect, role: ROLE_USER } | ||
65 | - - { path: ^/elfinder, role: ROLE_USER } | 63 | + - { path: ^/admin, roles: ROLE_ADMIN } |
64 | + - { path: ^/manutencao, roles: [ ROLE_ADMIN, ROLE_GESTAO ] } | ||
65 | + - { path: ^/, role: [ROLE_USER, ROLE_ADMIN, ROLE_GESTAO, ROLE_SUPERVISAO, ROLE_TECNICO ] } | ||
66 | + - { path: ^/efconnect, role: [ ROLE_USER, ROLE_ADMIN, ROLE_GESTAO, ROLE_SUPERVISAO, ROLE_TECNICO ] } | ||
67 | + - { path: ^/elfinder, role: [ ROLE_USER, ROLE_ADMIN, ROLE_GESTAO, ROLE_SUPERVISAO, ROLE_TECNICO ] } |
composer.json
@@ -47,7 +47,8 @@ | @@ -47,7 +47,8 @@ | ||
47 | "doctrine/doctrine-fixtures-bundle": "dev-master", | 47 | "doctrine/doctrine-fixtures-bundle": "dev-master", |
48 | "ijanki/ftp-bundle": "*", | 48 | "ijanki/ftp-bundle": "*", |
49 | "jms/translation-bundle": "1.1.*@dev", | 49 | "jms/translation-bundle": "1.1.*@dev", |
50 | - "helios-ag/fm-elfinder-bundle": "1.x", | 50 | + "helios-ag/fm-elfinder-bundle": "~2.5", |
51 | + "helios-ag/fm-elfinder-php-connector": "~2.0", | ||
51 | "knplabs/knp-menu": "~2.0", | 52 | "knplabs/knp-menu": "~2.0", |
52 | "knplabs/knp-menu-bundle": "~2.0", | 53 | "knplabs/knp-menu-bundle": "~2.0", |
53 | "jpgraph/jpgraph": "dev-master", | 54 | "jpgraph/jpgraph": "dev-master", |
composer.lock
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | - "hash": "2bfd0da0469386a6510b8353b8fd1ce5", | 7 | + "hash": "26259b90c15f97d94c17de0e76b7fb8f", |
8 | "packages": [ | 8 | "packages": [ |
9 | { | 9 | { |
10 | "name": "braincrafted/bootstrap-bundle", | 10 | "name": "braincrafted/bootstrap-bundle", |
@@ -1104,34 +1104,39 @@ | @@ -1104,34 +1104,39 @@ | ||
1104 | }, | 1104 | }, |
1105 | { | 1105 | { |
1106 | "name": "helios-ag/fm-elfinder-bundle", | 1106 | "name": "helios-ag/fm-elfinder-bundle", |
1107 | - "version": "1.5", | ||
1108 | - "target-dir": "FM/ElfinderBundle", | 1107 | + "version": "2.5", |
1109 | "source": { | 1108 | "source": { |
1110 | "type": "git", | 1109 | "type": "git", |
1111 | "url": "https://github.com/helios-ag/FMElfinderBundle.git", | 1110 | "url": "https://github.com/helios-ag/FMElfinderBundle.git", |
1112 | - "reference": "57de87e1bf72f9a87fa1d7cd508e7857a3d03860" | 1111 | + "reference": "955e8ec9ed63605f0aeedd2db99dc33818e0ddc8" |
1113 | }, | 1112 | }, |
1114 | "dist": { | 1113 | "dist": { |
1115 | "type": "zip", | 1114 | "type": "zip", |
1116 | - "url": "https://api.github.com/repos/helios-ag/FMElfinderBundle/zipball/57de87e1bf72f9a87fa1d7cd508e7857a3d03860", | ||
1117 | - "reference": "57de87e1bf72f9a87fa1d7cd508e7857a3d03860", | 1115 | + "url": "https://api.github.com/repos/helios-ag/FMElfinderBundle/zipball/955e8ec9ed63605f0aeedd2db99dc33818e0ddc8", |
1116 | + "reference": "955e8ec9ed63605f0aeedd2db99dc33818e0ddc8", | ||
1118 | "shasum": "" | 1117 | "shasum": "" |
1119 | }, | 1118 | }, |
1120 | "require": { | 1119 | "require": { |
1121 | - "helios-ag/fm-elfinder-php-connector": "1.1.1", | 1120 | + "helios-ag/fm-elfinder-php-connector": "~2.0", |
1122 | "php": ">=5.3.3", | 1121 | "php": ">=5.3.3", |
1123 | - "sensio/framework-extra-bundle": "*@dev", | ||
1124 | - "symfony/symfony": "*@stable", | ||
1125 | - "symfony/twig-bundle": "~2.0" | 1122 | + "symfony/framework-bundle": "~2.4", |
1123 | + "symfony/twig-bundle": "~2.4" | ||
1124 | + }, | ||
1125 | + "require-dev": { | ||
1126 | + "doctrine/doctrine-bundle": "~1.0", | ||
1127 | + "matthiasnoback/symfony-config-test": "0.*", | ||
1128 | + "matthiasnoback/symfony-dependency-injection-test": "0.*", | ||
1129 | + "symfony/form": "~2.1" | ||
1126 | }, | 1130 | }, |
1127 | "suggest": { | 1131 | "suggest": { |
1128 | - "Trsteel/ckeditor-bundle": "CKEditor WYSIWYG Editor Bundlefor Symfony2 Project by Trsteel", | ||
1129 | - "stfalcon/tinymce-bundle": "TinyMCE WYSIWYG Editor Bundle by Stfalcon" | 1132 | + "egeloen/ckeditor-bundle": "CKEditor Bundle by Egeloen", |
1133 | + "stfalcon/tinymce-bundle": "TinyMCE Bundle by Stfalcon", | ||
1134 | + "trsteel/ckeditor-bundle": "CKEditor Bundle by trsteel" | ||
1130 | }, | 1135 | }, |
1131 | "type": "symfony-bundle", | 1136 | "type": "symfony-bundle", |
1132 | "autoload": { | 1137 | "autoload": { |
1133 | - "psr-0": { | ||
1134 | - "FM\\ElfinderBundle": "" | 1138 | + "psr-4": { |
1139 | + "FM\\ElfinderBundle\\": "" | ||
1135 | } | 1140 | } |
1136 | }, | 1141 | }, |
1137 | "notification-url": "https://packagist.org/downloads/", | 1142 | "notification-url": "https://packagist.org/downloads/", |
@@ -1148,35 +1153,39 @@ | @@ -1148,35 +1153,39 @@ | ||
1148 | "homepage": "https://github.com/helios-ag/FMElfinderBundle/contributors" | 1153 | "homepage": "https://github.com/helios-ag/FMElfinderBundle/contributors" |
1149 | } | 1154 | } |
1150 | ], | 1155 | ], |
1151 | - "description": "ElFinder bundle, add ElFinder file manager to your Symfony2 project", | 1156 | + "description": "ElFinder bundle, adds ElFinder file manager to your Symfony2 project", |
1152 | "homepage": "https://github.com/helios-ag/FMElfinderBundle", | 1157 | "homepage": "https://github.com/helios-ag/FMElfinderBundle", |
1153 | "keywords": [ | 1158 | "keywords": [ |
1154 | "elfinder", | 1159 | "elfinder", |
1155 | "file manager" | 1160 | "file manager" |
1156 | ], | 1161 | ], |
1157 | - "time": "2014-05-09 12:02:28" | 1162 | + "time": "2014-10-11 09:18:19" |
1158 | }, | 1163 | }, |
1159 | { | 1164 | { |
1160 | "name": "helios-ag/fm-elfinder-php-connector", | 1165 | "name": "helios-ag/fm-elfinder-php-connector", |
1161 | - "version": "1.1.1", | 1166 | + "version": "2.1", |
1162 | "source": { | 1167 | "source": { |
1163 | "type": "git", | 1168 | "type": "git", |
1164 | "url": "https://github.com/helios-ag/ElFinderPHP.git", | 1169 | "url": "https://github.com/helios-ag/ElFinderPHP.git", |
1165 | - "reference": "fa24c5ce710ec2c9eab899786c93dfac1a232386" | 1170 | + "reference": "928d58b4a76d08c3c52b5a911500b0311b518802" |
1166 | }, | 1171 | }, |
1167 | "dist": { | 1172 | "dist": { |
1168 | "type": "zip", | 1173 | "type": "zip", |
1169 | - "url": "https://api.github.com/repos/helios-ag/ElFinderPHP/zipball/fa24c5ce710ec2c9eab899786c93dfac1a232386", | ||
1170 | - "reference": "fa24c5ce710ec2c9eab899786c93dfac1a232386", | 1174 | + "url": "https://api.github.com/repos/helios-ag/ElFinderPHP/zipball/928d58b4a76d08c3c52b5a911500b0311b518802", |
1175 | + "reference": "928d58b4a76d08c3c52b5a911500b0311b518802", | ||
1171 | "shasum": "" | 1176 | "shasum": "" |
1172 | }, | 1177 | }, |
1173 | "require": { | 1178 | "require": { |
1174 | - "php": ">=5.3.0" | 1179 | + "php": ">=5.3.3" |
1180 | + }, | ||
1181 | + "suggest": { | ||
1182 | + "aws/aws-sdk-php": "Allows you to use AWS S3 storage", | ||
1183 | + "dropbox-php/dropbox-php": "Allows you to use Dropbox storage" | ||
1175 | }, | 1184 | }, |
1176 | "type": "library", | 1185 | "type": "library", |
1177 | "autoload": { | 1186 | "autoload": { |
1178 | - "psr-0": { | ||
1179 | - "FM\\ElFinderPHP": "src/" | 1187 | + "psr-4": { |
1188 | + "FM\\ElFinderPHP\\": "src/" | ||
1180 | } | 1189 | } |
1181 | }, | 1190 | }, |
1182 | "notification-url": "https://packagist.org/downloads/", | 1191 | "notification-url": "https://packagist.org/downloads/", |
@@ -1185,7 +1194,7 @@ | @@ -1185,7 +1194,7 @@ | ||
1185 | ], | 1194 | ], |
1186 | "authors": [ | 1195 | "authors": [ |
1187 | { | 1196 | { |
1188 | - "name": "Albert Ganiev", | 1197 | + "name": "Al Ganiev", |
1189 | "email": "helios.ag@gmail.com" | 1198 | "email": "helios.ag@gmail.com" |
1190 | }, | 1199 | }, |
1191 | { | 1200 | { |
@@ -1203,7 +1212,7 @@ | @@ -1203,7 +1212,7 @@ | ||
1203 | "elfinder", | 1212 | "elfinder", |
1204 | "filemanager" | 1213 | "filemanager" |
1205 | ], | 1214 | ], |
1206 | - "time": "2013-08-06 17:02:04" | 1215 | + "time": "2014-10-17 10:43:45" |
1207 | }, | 1216 | }, |
1208 | { | 1217 | { |
1209 | "name": "ijanki/ftp-bundle", | 1218 | "name": "ijanki/ftp-bundle", |
@@ -2283,12 +2292,12 @@ | @@ -2283,12 +2292,12 @@ | ||
2283 | "source": { | 2292 | "source": { |
2284 | "type": "git", | 2293 | "type": "git", |
2285 | "url": "https://github.com/lightbase/cocar.git", | 2294 | "url": "https://github.com/lightbase/cocar.git", |
2286 | - "reference": "877b9496c3eb1682040298a7a3bb584aba5c5034" | 2295 | + "reference": "3a80e6a980a19c6d75c1dd672ffce8d68a54c9f0" |
2287 | }, | 2296 | }, |
2288 | "dist": { | 2297 | "dist": { |
2289 | "type": "zip", | 2298 | "type": "zip", |
2290 | - "url": "https://api.github.com/repos/lightbase/cocar/zipball/877b9496c3eb1682040298a7a3bb584aba5c5034", | ||
2291 | - "reference": "877b9496c3eb1682040298a7a3bb584aba5c5034", | 2299 | + "url": "https://api.github.com/repos/lightbase/cocar/zipball/3a80e6a980a19c6d75c1dd672ffce8d68a54c9f0", |
2300 | + "reference": "3a80e6a980a19c6d75c1dd672ffce8d68a54c9f0", | ||
2292 | "shasum": "" | 2301 | "shasum": "" |
2293 | }, | 2302 | }, |
2294 | "require": { | 2303 | "require": { |
@@ -2319,7 +2328,7 @@ | @@ -2319,7 +2328,7 @@ | ||
2319 | "support": { | 2328 | "support": { |
2320 | "source": "https://github.com/lightbase/cocar/tree/master" | 2329 | "source": "https://github.com/lightbase/cocar/tree/master" |
2321 | }, | 2330 | }, |
2322 | - "time": "2014-09-22 12:29:23" | 2331 | + "time": "2014-10-15 20:35:53" |
2323 | }, | 2332 | }, |
2324 | { | 2333 | { |
2325 | "name": "liip/functional-test-bundle", | 2334 | "name": "liip/functional-test-bundle", |
@@ -0,0 +1,346 @@ | @@ -0,0 +1,346 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: eduardo | ||
5 | + * Date: 18/10/14 | ||
6 | + * Time: 23:49 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace Cacic\CommonBundle\Controller; | ||
10 | + | ||
11 | +use Cacic\CommonBundle\Form\Type\AgenteType; | ||
12 | +use Cacic\CommonBundle\Form\Type\DeployType; | ||
13 | +use Symfony\Component\HttpFoundation\Request; | ||
14 | +use Symfony\Component\HttpFoundation\Response; | ||
15 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
16 | +use Symfony\Component\Finder\Finder; | ||
17 | +use PharData; | ||
18 | +use Symfony\Component\Security\Acl\Exception\Exception; | ||
19 | +use ZipArchive; | ||
20 | + | ||
21 | + | ||
22 | +class AgenteController extends Controller { | ||
23 | + | ||
24 | + public function indexAction(Request $request) { | ||
25 | + $logger = $this->get('logger'); | ||
26 | + // Cria diretório dos agentes se não existir | ||
27 | + $rootDir = $this->container->get('kernel')->getRootDir(); | ||
28 | + $webDir = $rootDir . "/../web/"; | ||
29 | + $downloadsDir = $webDir . "downloads/"; | ||
30 | + if (!is_dir($downloadsDir)) { | ||
31 | + mkdir($downloadsDir); | ||
32 | + } | ||
33 | + | ||
34 | + $cacicDir = $downloadsDir . "cacic/"; | ||
35 | + if (!is_dir($cacicDir)) { | ||
36 | + mkdir($cacicDir); | ||
37 | + } | ||
38 | + | ||
39 | + $linuxDir = $cacicDir . "linux/"; | ||
40 | + if (!is_dir($linuxDir)) { | ||
41 | + mkdir($linuxDir); | ||
42 | + } | ||
43 | + | ||
44 | + $windowsDir = $cacicDir . "windows/"; | ||
45 | + if (!is_dir($windowsDir)) { | ||
46 | + mkdir($windowsDir); | ||
47 | + } | ||
48 | + | ||
49 | + | ||
50 | + $outrosDir = $downloadsDir . "outros/"; | ||
51 | + if (!is_dir($outrosDir)) { | ||
52 | + mkdir($outrosDir); | ||
53 | + } | ||
54 | + | ||
55 | + | ||
56 | + $form = $this->createForm( new AgenteType() ); | ||
57 | + $locale = $request->getLocale(); | ||
58 | + | ||
59 | + // Constrói array de arquivos e hashes | ||
60 | + $finder = new Finder(); | ||
61 | + $agentes = new Finder(); | ||
62 | + $saida = array(); | ||
63 | + $base_url = $request->getBaseUrl(); | ||
64 | + $base_url = preg_replace('/\/app.*.php/', "/", $base_url); | ||
65 | + | ||
66 | + // Primeiro tratamos agentes Linux | ||
67 | + // A regra é que o agente mais atual estará na pasta current | ||
68 | + $finder->directories()->in($linuxDir); | ||
69 | + $saida['linux']['versions'] = array(); | ||
70 | + foreach($finder as $version) { | ||
71 | + if ($version->getFileName() == 'current') { | ||
72 | + continue; | ||
73 | + } | ||
74 | + $saida['linux']['versions'][$version->getFileName()] = array(); | ||
75 | + $agentes->files()->in($version->getRealPath()); | ||
76 | + foreach ($agentes as $file) { | ||
77 | + array_push($saida['linux']['versions'][$version->getFileName()], array( | ||
78 | + 'name' => $file->getFileName(), | ||
79 | + 'download_url' => $base_url . 'downloads/cacic/linux/' . $version->getFileName() . '/' . $file->getFileName(), | ||
80 | + 'hash' => md5_file($file->getRealPath()), | ||
81 | + 'size' => $file->getSize(), | ||
82 | + 'filename' => 'cacic/linux/' . $version->getFileName() . '/' . $file->getFileName() | ||
83 | + )); | ||
84 | + | ||
85 | + } | ||
86 | + } | ||
87 | + // Get latest version | ||
88 | + $current = basename(readlink($cacicDir."current")); | ||
89 | + $saida['linux']['live_version'] = $current; | ||
90 | + | ||
91 | + // Aí tratamos Windows | ||
92 | + $finder->directories()->in($windowsDir); | ||
93 | + $saida['windows']['versions'] = array(); | ||
94 | + foreach($finder as $version) { | ||
95 | + if ($version->getFileName() == 'current') { | ||
96 | + continue; | ||
97 | + } | ||
98 | + $saida['windows']['versions'][$version->getFileName()] = array(); | ||
99 | + $agentes->files()->in($version->getRealPath()); | ||
100 | + foreach ($agentes as $file) { | ||
101 | + array_push($saida['windows']['versions'][$version->getFileName()], array( | ||
102 | + 'name' => $file->getFileName(), | ||
103 | + 'download_url' => $base_url . 'downloads/cacic/windows/' . $version->getFileName() . '/' . $file->getFileName(), | ||
104 | + 'hash' => md5_file($file->getRealPath()), | ||
105 | + 'size' => $file->getSize(), | ||
106 | + 'filename' => 'cacic/windows/' . $version->getFileName() . '/' . $file->getFileName() | ||
107 | + )); | ||
108 | + | ||
109 | + } | ||
110 | + } | ||
111 | + // Get latest version | ||
112 | + $current = basename(readlink($windowsDir."current")); | ||
113 | + $saida['windows']['live_version'] = $current; | ||
114 | + | ||
115 | + //$logger->debug("4444444444444444444444444444444444 ".print_r($saida, true)); | ||
116 | + | ||
117 | + if ( $request->isMethod('POST') ) | ||
118 | + { | ||
119 | + // Aqui vamos fazer o tratamento dos agentes | ||
120 | + $data = $form->getData(); | ||
121 | + $data['windows_version'] = $request->get('agentes')['windows_version']; | ||
122 | + $data['linux_version'] = $request->get('agentes')['linux_version']; | ||
123 | + $files = $request->files->get('agentes'); | ||
124 | + | ||
125 | + //$logger->debug("99999999999999999999999999999999999 ".print_r($data, true)); | ||
126 | + if (!empty($files['windows'])) { | ||
127 | + //$logger->debug("88888888888888888888888888888888888888 ".print_r($files['windows'], true)); | ||
128 | + if (empty($data['windows_version'])) { | ||
129 | + $logger->error("O parâmetro versão é obrigatório"); | ||
130 | + $this->get('session')->getFlashBag()->add('error', 'O parâmetro versão é obrigatório'); | ||
131 | + } else { | ||
132 | + $versionDir = $windowsDir . $data['windows_version']; | ||
133 | + $result = $this->uploadPackage($files['windows'], $versionDir); | ||
134 | + if (!$result) { | ||
135 | + $logger->error("Erro na atualização dos Agentes Windows"); | ||
136 | + $this->get('session')->getFlashBag()->add('error', 'Erro na atualização dos agentes Windows'); | ||
137 | + } else { | ||
138 | + // Make this version current | ||
139 | + $logger->debug("Agentes atualizados com sucesso"); | ||
140 | + symlink($versionDir, "$windowsDir"."current"); | ||
141 | + $this->get('session')->getFlashBag()->add('success', 'Agentes atualizados com sucesso!'); | ||
142 | + } | ||
143 | + } | ||
144 | + } | ||
145 | + | ||
146 | + if (!empty($files['linux'])) { | ||
147 | + if (empty($data['linux_version'])) { | ||
148 | + $logger->error("O parâmetro versão é obrigatório"); | ||
149 | + $this->get('session')->getFlashBag()->add('error', 'O parâmetro versão é obrigatório'); | ||
150 | + } else { | ||
151 | + $versionDir = $linuxDir . $data['linux_version']; | ||
152 | + $result = $this->uploadPackage($files['linux'], $versionDir); | ||
153 | + if (!$result) { | ||
154 | + $logger->error("Erro na atualização dos Agentes Linux"); | ||
155 | + $this->get('session')->getFlashBag()->add('error', 'Erro na atualização dos agentes Linux'); | ||
156 | + } else { | ||
157 | + // Make this version current | ||
158 | + symlink($versionDir, $linuxDir."current"); | ||
159 | + $this->get('session')->getFlashBag()->add('success', 'Agentes atualizados com sucesso!'); | ||
160 | + } | ||
161 | + } | ||
162 | + } | ||
163 | + | ||
164 | + } | ||
165 | + | ||
166 | + return $this->render( 'CacicCommonBundle:Agente:index.html.twig', | ||
167 | + array( | ||
168 | + 'local'=>$locale, | ||
169 | + 'saida' => $saida, | ||
170 | + 'form' => $form->createView() | ||
171 | + ) | ||
172 | + ); | ||
173 | + } | ||
174 | + | ||
175 | + public function uploadPackage($file, $version) { | ||
176 | + $logger = $this->get('logger'); | ||
177 | + if (!$file->isValid()) { | ||
178 | + $logger->error("Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage()); | ||
179 | + $this->get('session')->getFlashBag()->add('error', "Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage()); | ||
180 | + return false; | ||
181 | + } | ||
182 | + $result = false; | ||
183 | + mkdir($version); | ||
184 | + //$logger->debug("66666666666666666666666666666666666 ".print_r($file, true)); | ||
185 | + | ||
186 | + $extension = $file->getClientOriginalExtension(); | ||
187 | + //$logger->debug("00000000000000000000000000000000000000000 $extension | $version"); | ||
188 | + | ||
189 | + if ($extension == 'zip') { | ||
190 | + $zip = new ZipArchive; | ||
191 | + if ($zip->open($file) === TRUE) { | ||
192 | + $zip->extractTo($version); | ||
193 | + $zip->close(); | ||
194 | + $logger->debug("Arquivo .zip descompactado com sucesso ". $file->getClientOriginalName()); | ||
195 | + $result = true; | ||
196 | + } else { | ||
197 | + $logger->error("Erro na descompactação do arquivo .zip ". $file->getClientOriginalName()); | ||
198 | + $this->get('session')->getFlashBag()->add('error', "Erro na descompatcação do arquivo .zip\n".$file->getErrorMessage()); | ||
199 | + $result = false; | ||
200 | + } | ||
201 | + | ||
202 | + } elseif ($extension == 'gz') { | ||
203 | + try { | ||
204 | + // decompress from gz | ||
205 | + $tar = $version.$file->getClientOriginalName(); | ||
206 | + $p = new PharData($tar, 0, $file); | ||
207 | + $p->decompress(); | ||
208 | + | ||
209 | + // Now unarchive from tar | ||
210 | + $phar = new PharData($tar); | ||
211 | + $phar->extractTo($version); | ||
212 | + | ||
213 | + // Remove file | ||
214 | + unlink($tar); | ||
215 | + | ||
216 | + $result = true; | ||
217 | + } catch (Exception $e) { | ||
218 | + $logger->error("Erro na extração do arquivo .gz \n".$e->getMessage()); | ||
219 | + $this->get('session')->getFlashBag()->add('error', "Erro na extração do arquivo .gz\n".$file->getErrorMessage()); | ||
220 | + $result = false; | ||
221 | + } | ||
222 | + | ||
223 | + } else { | ||
224 | + $logger->error("Extensão inválida para upload dos agentes ".$extension); | ||
225 | + $this->get('session')->getFlashBag()->add('error', "Extensão inválida para upload dos agentes ".$extension); | ||
226 | + $result = false; | ||
227 | + } | ||
228 | + | ||
229 | + return $result; | ||
230 | + } | ||
231 | + | ||
232 | + public function excluirAction(Request $request) { | ||
233 | + if ( ! $request->isXmlHttpRequest() ) | ||
234 | + throw $this->createNotFoundException( 'Página não encontrada' ); | ||
235 | + | ||
236 | + | ||
237 | + | ||
238 | + $rootDir = $this->container->get('kernel')->getRootDir(); | ||
239 | + $webDir = $rootDir . "/../web/"; | ||
240 | + $downloadsDir = $webDir . "downloads/"; | ||
241 | + $filepath = $downloadsDir . $request->get('id'); | ||
242 | + | ||
243 | + $this->get('logger')->debug("Excluindo arquivo de agente ".$filepath); | ||
244 | + | ||
245 | + $result = unlink($filepath); | ||
246 | + | ||
247 | + if ($result) { | ||
248 | + $response = new Response( json_encode( array('status' => 'ok') ) ); | ||
249 | + $response->headers->set('Content-Type', 'application/json'); | ||
250 | + } else { | ||
251 | + $response = new Response( json_encode( array('status' => 'error') ) ); | ||
252 | + $response->headers->set('Content-Type', 'application/json'); | ||
253 | + } | ||
254 | + | ||
255 | + return $response; | ||
256 | + } | ||
257 | + | ||
258 | + public function deployAction(Request $request) { | ||
259 | + $logger = $this->get('logger'); | ||
260 | + // Cria diretório dos agentes se não existir | ||
261 | + $rootDir = $this->container->get('kernel')->getRootDir(); | ||
262 | + $webDir = $rootDir . "/../web/"; | ||
263 | + $downloadsDir = $webDir . "downloads/"; | ||
264 | + if (!is_dir($downloadsDir)) { | ||
265 | + mkdir($downloadsDir); | ||
266 | + } | ||
267 | + | ||
268 | + $outrosDir = $downloadsDir . "outros/"; | ||
269 | + if (!is_dir($outrosDir)) { | ||
270 | + mkdir($outrosDir); | ||
271 | + } | ||
272 | + | ||
273 | + | ||
274 | + $form = $this->createForm( new DeployType() ); | ||
275 | + $locale = $request->getLocale(); | ||
276 | + | ||
277 | + // Constrói array de arquivos e hashes | ||
278 | + $finder = new Finder(); | ||
279 | + $agentes = new Finder(); | ||
280 | + $saida = array(); | ||
281 | + $base_url = $request->getBaseUrl(); | ||
282 | + $base_url = preg_replace('/\/app.*.php/', "/", $base_url); | ||
283 | + | ||
284 | + // Tratamos upload de módulos genéricos | ||
285 | + $finder->files()->in($outrosDir); | ||
286 | + $saida['outros'] = array(); | ||
287 | + foreach($finder as $file) { | ||
288 | + array_push($saida['outros'], array( | ||
289 | + 'name' => $file->getFileName(), | ||
290 | + 'download_url' => $base_url . 'downloads/outros/' . $file->getFileName(), | ||
291 | + 'hash' => md5_file($file->getRealPath()), | ||
292 | + 'size' => $file->getSize(), | ||
293 | + 'filename' => "outros/" . $file->getFileName() | ||
294 | + )); | ||
295 | + | ||
296 | + } | ||
297 | + | ||
298 | + if ( $request->isMethod('POST') ) | ||
299 | + { | ||
300 | + // Aqui vamos fazer o tratamento dos agentes | ||
301 | + $files = $request->files->get('deploy'); | ||
302 | + | ||
303 | + //$logger->debug("99999999999999999999999999999999999 ".print_r($files, true)); | ||
304 | + if (!empty($files['outros'])) { | ||
305 | + //$logger->debug("88888888888888888888888888888888888888 ".print_r($files['outros'], true)); | ||
306 | + $result = $this->uploadFile($files['outros'], $outrosDir); | ||
307 | + if (!$result) { | ||
308 | + $logger->error("Erro no upload do módulo"); | ||
309 | + $this->get('session')->getFlashBag()->add('error', 'Erro no upload do módulo'); | ||
310 | + } else { | ||
311 | + // Make this version current | ||
312 | + $logger->debug("Upload do módulo realizado com sucesso"); | ||
313 | + $this->get('session')->getFlashBag()->add('success', 'Upload do módulo realizado com sucesso!'); | ||
314 | + } | ||
315 | + } | ||
316 | + | ||
317 | + } | ||
318 | + | ||
319 | + $logger->debug("3333333333333333333333333333333333333333 ".print_r($saida, true)); | ||
320 | + | ||
321 | + return $this->render( 'CacicCommonBundle:Agente:deploy.html.twig', | ||
322 | + array( | ||
323 | + 'local'=>$locale, | ||
324 | + 'saida' => $saida, | ||
325 | + 'form' => $form->createView() | ||
326 | + ) | ||
327 | + ); | ||
328 | + } | ||
329 | + | ||
330 | + public function uploadFile($file, $version) { | ||
331 | + $logger = $this->get('logger'); | ||
332 | + if (!$file->isValid()) { | ||
333 | + $logger->error("Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage()); | ||
334 | + $this->get('session')->getFlashBag()->add('error', "Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage()); | ||
335 | + return false; | ||
336 | + } | ||
337 | + | ||
338 | + mkdir($version); | ||
339 | + $file->move($version, $file->getClientOriginalName()); | ||
340 | + $result = true; | ||
341 | + $logger->debug("Upload do módulo realizado com sucesso"); | ||
342 | + | ||
343 | + return $result; | ||
344 | + } | ||
345 | + | ||
346 | +} | ||
0 | \ No newline at end of file | 347 | \ No newline at end of file |
src/Cacic/CommonBundle/Controller/RedeController.php
@@ -13,6 +13,7 @@ use Cacic\WSBundle\Helper; | @@ -13,6 +13,7 @@ use Cacic\WSBundle\Helper; | ||
13 | use Cacic\CommonBundle\Helper as CacicHelper; | 13 | use Cacic\CommonBundle\Helper as CacicHelper; |
14 | use Ijanki\Bundle\FtpBundle\Exception\FtpException; | 14 | use Ijanki\Bundle\FtpBundle\Exception\FtpException; |
15 | use Symfony\Component\Validator\Constraints\Null; | 15 | use Symfony\Component\Validator\Constraints\Null; |
16 | +use Symfony\Component\Finder\Finder; | ||
16 | 17 | ||
17 | /** | 18 | /** |
18 | * | 19 | * |
@@ -490,6 +491,8 @@ class RedeController extends Controller | @@ -490,6 +491,8 @@ class RedeController extends Controller | ||
490 | $em->persist($redeVersaoModulo); | 491 | $em->persist($redeVersaoModulo); |
491 | $em->flush(); | 492 | $em->flush(); |
492 | 493 | ||
494 | + } else { | ||
495 | + $logger->error("Erro no envio do módulo via FTP \n".$arrResult[1]); | ||
493 | } | 496 | } |
494 | 497 | ||
495 | //echo $_GET['pIntIdRede'] . '_=_' . $_GET['pStrNmItem'] . '_=_' . $strResult; | 498 | //echo $_GET['pIntIdRede'] . '_=_' . $_GET['pStrNmItem'] . '_=_' . $strResult; |
@@ -540,7 +543,7 @@ class RedeController extends Controller | @@ -540,7 +543,7 @@ class RedeController extends Controller | ||
540 | $logger->debug("Enviando módulo $pStrFullItemName para o servidor $pStrTeServer na pasta $pStrTePathServer"); | 543 | $logger->debug("Enviando módulo $pStrFullItemName para o servidor $pStrTeServer na pasta $pStrTePathServer"); |
541 | 544 | ||
542 | 545 | ||
543 | - $conn = $ftp->connect($pStrTeServer); | 546 | + $conn = $ftp->connect($pStrTeServer, $pStrNuPortaServer); |
544 | // Retorno esperado....: 230 => FTP_USER_LOGGED_IN | 547 | // Retorno esperado....: 230 => FTP_USER_LOGGED_IN |
545 | // Retorno NÃO esperado: 530 => FTP_USER_NOT_LOGGED_IN | 548 | // Retorno NÃO esperado: 530 => FTP_USER_NOT_LOGGED_IN |
546 | 549 | ||
@@ -669,4 +672,328 @@ class RedeController extends Controller | @@ -669,4 +672,328 @@ class RedeController extends Controller | ||
669 | ) | 672 | ) |
670 | ); | 673 | ); |
671 | } | 674 | } |
675 | + | ||
676 | + /** | ||
677 | + * Função nova para atualização das subredes | ||
678 | + * | ||
679 | + * @param Request $request | ||
680 | + * @return Response | ||
681 | + */ | ||
682 | + public function manutencaoNeoAction(Request $request) | ||
683 | + { | ||
684 | + $logger = $this->get('logger'); | ||
685 | + | ||
686 | + // Primeiro carrega lista dos módulos | ||
687 | + $modulos = $this->modulosNeoArray($request); | ||
688 | + | ||
689 | + | ||
690 | + if ( $request->isMethod('POST') ) | ||
691 | + { | ||
692 | + if ( count( $request->get('subrede') ) ) | ||
693 | + { | ||
694 | + $retorno = true; | ||
695 | + foreach ( $request->get('subrede') as $resultado ) | ||
696 | + { | ||
697 | + $logger->debug("Atualizando a subrede {$resultado} ..."); | ||
698 | + | ||
699 | + // Junta os módulos windows e linux para enviar para o update de subredes | ||
700 | + $atualizaWindows = $request->get('windows'); | ||
701 | + $atualizaLinux = $request->get('linux'); | ||
702 | + | ||
703 | + // FIXME: Na requisição só vem o nome dos módulos. Precisa carregar as outras informações. | ||
704 | + | ||
705 | + // Evita Warning do array merge se um dos dois for vazio | ||
706 | + if (empty($atualizaLinux)) { | ||
707 | + $atualiza = $atualizaWindows; | ||
708 | + } elseif (empty($atualizaWindows)) { | ||
709 | + $atualiza = $atualizaLinux; | ||
710 | + } else { | ||
711 | + $atualiza = array_merge($atualizaWindows, $atualizaLinux); | ||
712 | + } | ||
713 | + | ||
714 | + // Passa a rede como parâmetro | ||
715 | + $redeAtualizar = $this->getDoctrine()->getManager()->find('CacicCommonBundle:Rede', $resultado); | ||
716 | + | ||
717 | + | ||
718 | + // Executa a atualização de todos os módulos marcados para a subrede marcada | ||
719 | + $result = $this->updateSubredesNeo($request, $redeAtualizar, $atualiza); | ||
720 | + if (!$result) { | ||
721 | + $retorno = $result; | ||
722 | + } | ||
723 | + } | ||
724 | + if ($retorno) { | ||
725 | + $this->get('session')->getFlashBag()->add('success', 'Dados salvos com sucesso!'); | ||
726 | + } else { | ||
727 | + $this->get('session')->getFlashBag()->add('error', 'Erro na atualização das subredes'); | ||
728 | + } | ||
729 | + | ||
730 | + } | ||
731 | + } | ||
732 | + | ||
733 | + // Lista de subredes e módulos | ||
734 | + $subredesOrig = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->comLocal(); | ||
735 | + | ||
736 | + // Varro todas as subredes para cada módulo | ||
737 | + $subredes = array(); | ||
738 | + $windows = array(); | ||
739 | + $linux = array(); | ||
740 | + foreach ($subredesOrig as $redeItem) { | ||
741 | + // Busca o módulo em cada uma das redes | ||
742 | + $codigos = array(); | ||
743 | + foreach ($modulos as $key => $value) { | ||
744 | + $idRede = $redeItem['idRede']; | ||
745 | + // Verifico se o módulo existe na subrede | ||
746 | + $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:RedeVersaoModulo')->subrede($idRede, $key); | ||
747 | + | ||
748 | + if (empty($rede)) { | ||
749 | + // O módulo não foi encontrado. Adiciona o código 1 | ||
750 | + array_push($codigos, 0); | ||
751 | + //$rede = $redeItem[0]; | ||
752 | + } else { | ||
753 | + if ($value['hash'] == $rede[0]['teHash']) { | ||
754 | + // Se o hash for igual, adiciona o código 2 | ||
755 | + array_push($codigos, 2); | ||
756 | + | ||
757 | + } else { | ||
758 | + // Se o hash for diferente, adiciona o código 1 | ||
759 | + array_push($codigos, 1); | ||
760 | + } | ||
761 | + } | ||
762 | + | ||
763 | + // Cria um array para Windows e outro para Linux | ||
764 | + if ($value['tipoSo'] == 'windows') { | ||
765 | + $windows[$key] = $value; | ||
766 | + } else { | ||
767 | + $linux[$key] = $value; | ||
768 | + } | ||
769 | + | ||
770 | + } | ||
771 | + | ||
772 | + // Define o elemento HTML para os módulos | ||
773 | + if (in_array(0, $codigos)) { | ||
774 | + // Se o código 0 for encontrato, marcamos o módulo como inexistente | ||
775 | + if (empty($rede)) { | ||
776 | + $rede[0] = $redeItem; | ||
777 | + } | ||
778 | + $subredes["$idRede"]['teIpRede'] = $rede[0]['teIpRede']; | ||
779 | + $subredes["$idRede"]['nmRede'] = $rede[0]['nmRede']; | ||
780 | + $subredes["$idRede"]['teServUpdates'] = $rede[0]['teServUpdates']; | ||
781 | + $subredes["$idRede"]['tePathServUpdates'] = $rede[0]['tePathServUpdates']; | ||
782 | + $subredes["$idRede"]['nmLocal'] = $rede[0]['nmLocal']; | ||
783 | + $subredes["$idRede"]['codigo'] = "<span class='label label-important'>Módulos inexistentes</span>"; | ||
784 | + } elseif (in_array(1, $codigos)) { | ||
785 | + // Se o código 1 for encontrado, alguns módulos estão desatualizados | ||
786 | + $subredes["$idRede"]['teIpRede'] = $rede[0]['teIpRede']; | ||
787 | + $subredes["$idRede"]['nmRede'] = $rede[0]['nmRede']; | ||
788 | + $subredes["$idRede"]['teServUpdates'] = $rede[0]['teServUpdates']; | ||
789 | + $subredes["$idRede"]['tePathServUpdates'] = $rede[0]['tePathServUpdates']; | ||
790 | + $subredes["$idRede"]['nmLocal'] = $rede[0]['nmLocal']; | ||
791 | + $subredes["$idRede"]['codigo'] = "<span class='label label-warning'>Módulos desatualizados</span>"; | ||
792 | + } else { | ||
793 | + // Se não existe nenhum módulo inexistente ou desatualizado, está tudo 100% atualizado | ||
794 | + $subredes["$idRede"]['teIpRede'] = $rede[0]['teIpRede']; | ||
795 | + $subredes["$idRede"]['nmRede'] = $rede[0]['nmRede']; | ||
796 | + $subredes["$idRede"]['teServUpdates'] = $rede[0]['teServUpdates']; | ||
797 | + $subredes["$idRede"]['tePathServUpdates'] = $rede[0]['tePathServUpdates']; | ||
798 | + $subredes["$idRede"]['nmLocal'] = $rede[0]['nmLocal']; | ||
799 | + $subredes["$idRede"]['codigo'] = "<span class='label label-success'>Módulos atualizados</span>"; | ||
800 | + } | ||
801 | + } | ||
802 | + | ||
803 | + return $this->render( 'CacicCommonBundle:Rede:manutencaoNeo.html.twig', | ||
804 | + array( | ||
805 | + 'windows'=> $windows, | ||
806 | + 'linux' => $linux, | ||
807 | + 'subredes' => $subredes | ||
808 | + ) | ||
809 | + ); | ||
810 | + | ||
811 | + } | ||
812 | + | ||
813 | + /* | ||
814 | + * Função que retorna um array multidimensional com o nome dos executáveis, | ||
815 | + * o hash e versão constantes do arquivo versions_and_hashes.ini | ||
816 | + * | ||
817 | + * @param nmModulo Nome do módulo para trazer informações | ||
818 | + * | ||
819 | + * @return Array multidimensional com os dados | ||
820 | + */ | ||
821 | + | ||
822 | + public function modulosNeoArray(Request $request, $nmModulos = null) | ||
823 | + { | ||
824 | + $logger = $this->get('logger'); | ||
825 | + // Abre e faz o parsing do arquivo | ||
826 | + $cacic_helper = new Helper\OldCacicHelper($this->container->get('kernel')); | ||
827 | + $iniFile = $cacic_helper->iniFile(); | ||
828 | + $itemArray = parse_ini_file($iniFile); | ||
829 | + $teste = parse_ini_file($iniFile, true); | ||
830 | + | ||
831 | + // Varre o diretório em busca dos módulos | ||
832 | + $rootDir = $this->container->get('kernel')->getRootDir(); | ||
833 | + $webDir = $rootDir . "/../web/"; | ||
834 | + $downloadsDir = $webDir . "downloads/"; | ||
835 | + $cacicDir = $downloadsDir . "cacic/"; | ||
836 | + $linuxDir = $cacicDir . "linux/"; | ||
837 | + $windowsDir = $cacicDir . "windows/"; | ||
838 | + $outrosDir = $downloadsDir . "outros/"; | ||
839 | + | ||
840 | + // Constrói array de arquivos e hashes | ||
841 | + $finder = new Finder(); | ||
842 | + $agentes = new Finder(); | ||
843 | + $saida = array(); | ||
844 | + $base_url = $request->getBaseUrl(); | ||
845 | + $base_url = preg_replace('/\/app.*.php/', "/", $base_url); | ||
846 | + | ||
847 | + // Primeiro tratamos agentes Linux | ||
848 | + // A regra é que o agente mais atual estará na pasta current | ||
849 | + $current = basename(readlink($linuxDir."current")); | ||
850 | + $finder->directories()->in($linuxDir); | ||
851 | + foreach($finder as $version) { | ||
852 | + if ($version->getFileName() == 'current') { | ||
853 | + // Aqui considera somente a última versão | ||
854 | + $agentes->files()->in($version->getRealPath()); | ||
855 | + foreach ($agentes as $file) { | ||
856 | + if (!empty($nmModulos)) { | ||
857 | + // Filtra por nome de módulo | ||
858 | + if (!in_array($file->getFileName(), $nmModulos)) { | ||
859 | + continue; | ||
860 | + } | ||
861 | + } | ||
862 | + $saida[$file->getFileName()] = array( | ||
863 | + 'name' => $file->getFileName(), | ||
864 | + 'versao' => $current, | ||
865 | + 'download_url' => $base_url . 'downloads/cacic/linux/' . $version->getFileName() . '/' . $file->getFileName(), | ||
866 | + 'hash' => md5_file($file->getRealPath()), | ||
867 | + 'size' => $file->getSize(), | ||
868 | + 'filename' => 'cacic/linux/' . $version->getFileName() . '/' . $file->getFileName(), | ||
869 | + 'tipoSo' => 'linux' | ||
870 | + ); | ||
871 | + } | ||
872 | + } else { | ||
873 | + continue; | ||
874 | + } | ||
875 | + | ||
876 | + } | ||
877 | + // Get latest version | ||
878 | + //$current = basename(readlink($cacicDir."current")); | ||
879 | + //$saida['linux']['live_version'] = $current; | ||
880 | + | ||
881 | + // Aí tratamos Windows | ||
882 | + $finder->directories()->in($windowsDir); | ||
883 | + $current = basename(readlink($windowsDir."current")); | ||
884 | + foreach($finder as $version) { | ||
885 | + if ($version->getFileName() == 'current') { | ||
886 | + // Aqui considera somente a última versão | ||
887 | + $agentes->files()->in($version->getRealPath()); | ||
888 | + foreach ($agentes as $file) { | ||
889 | + if (!empty($nmModulos)) { | ||
890 | + // Filtra por nome de módulo | ||
891 | + if (!in_array($file->getFileName(), $nmModulos)) { | ||
892 | + continue; | ||
893 | + } | ||
894 | + } | ||
895 | + $saida[$file->getFileName()] = array( | ||
896 | + 'name' => $file->getFileName(), | ||
897 | + 'versao' => $current, | ||
898 | + 'download_url' => $base_url . 'downloads/cacic/windows/' . $version->getFileName() . '/' . $file->getFileName(), | ||
899 | + 'hash' => md5_file($file->getRealPath()), | ||
900 | + 'size' => $file->getSize(), | ||
901 | + 'filename' => 'cacic/windows/' . $version->getFileName() . '/' . $file->getFileName(), | ||
902 | + 'tipoSo' => 'windows' | ||
903 | + ); | ||
904 | + } | ||
905 | + } else { | ||
906 | + continue; | ||
907 | + } | ||
908 | + | ||
909 | + } | ||
910 | + // Get latest version | ||
911 | + //$current = basename(readlink($windowsDir."current")); | ||
912 | + //$saida['windows']['live_version'] = $current; | ||
913 | + | ||
914 | + // Retorna o array com todos os resultados | ||
915 | + return $saida; | ||
916 | + } | ||
917 | + | ||
918 | + public function updateSubredesNeo(Request $request, $rede, $modulos = null) | ||
919 | + { | ||
920 | + $logger = $this->get('logger'); | ||
921 | + $pIntIdRede = $rede->getIdRede(); | ||
922 | + | ||
923 | + // Varre o diretório em busca dos módulos | ||
924 | + $rootDir = $this->container->get('kernel')->getRootDir(); | ||
925 | + $webDir = $rootDir . "/../web/"; | ||
926 | + $downloadsDir = $webDir . "downloads/"; | ||
927 | + $cacicDir = $downloadsDir . "cacic/"; | ||
928 | + $linuxDir = $cacicDir . "linux/"; | ||
929 | + $windowsDir = $cacicDir . "windows/"; | ||
930 | + $outrosDir = $downloadsDir . "outros/"; | ||
931 | + | ||
932 | + // Carrega todos os metadados dos módulos fornecidos ou de todos os módulos | ||
933 | + $modulos = $this->modulosNeoArray($request, $modulos); | ||
934 | + $logger->debug("6666666666666666666666666666666666666 ".print_r($modulos, true)); | ||
935 | + | ||
936 | + foreach ($modulos as $key => $value) | ||
937 | + { | ||
938 | + $logger->debug("Nome do módulo: $key"); | ||
939 | + | ||
940 | + // Carrega dados da rede | ||
941 | + $em = $this->getDoctrine()->getManager(); | ||
942 | + //$arrDadosRede = array( 'rede' => $em->getRepository( 'CacicCommonBundle:Rede' )->listar() ); | ||
943 | + //Debug::dump($arrDadosRede['rede'][0][0]); | ||
944 | + //$arrDadosRede = $arrDadosRede['rede'][0]; | ||
945 | + $arrDadosRede = array( | ||
946 | + 'teServUpdates' => $rede->getTeServUpdates(), | ||
947 | + 'tePathServUpdates' => $rede->getTePathServUpdates(), | ||
948 | + 'nmUsuarioLoginServUpdatesGerente' => $rede->getNmUsuarioLoginServUpdatesGerente(), | ||
949 | + 'teSenhaLoginServUpdatesGerente' => $rede->getTeSenhaLoginServUpdatesGerente(), | ||
950 | + 'nuPortaServUpdates' => $rede->getNuPortaServUpdates(), | ||
951 | + ); | ||
952 | + | ||
953 | + $strResult = $this->checkAndSend( | ||
954 | + $value['name'], | ||
955 | + $downloadsDir . $value['filename'], | ||
956 | + $arrDadosRede['teServUpdates'], | ||
957 | + $arrDadosRede['tePathServUpdates'], | ||
958 | + $arrDadosRede['nmUsuarioLoginServUpdatesGerente'], | ||
959 | + $arrDadosRede['teSenhaLoginServUpdatesGerente'], | ||
960 | + $arrDadosRede['nuPortaServUpdates'] | ||
961 | + ); | ||
962 | + | ||
963 | + $arrResult = explode('_=_',$strResult); | ||
964 | + | ||
965 | + if ($arrResult[1] == 'Ok!') | ||
966 | + { | ||
967 | + // Consertar CRUD no Symfony | ||
968 | + $redeVersaoModulo = $em->getRepository('CacicCommonBundle:RedeVersaoModulo')->findOneBy( | ||
969 | + array( | ||
970 | + 'idRede' => $pIntIdRede, | ||
971 | + 'nmModulo' => $value['name'] | ||
972 | + ) | ||
973 | + ); | ||
974 | + | ||
975 | + // Se não existir, instancia o objeto | ||
976 | + if (empty($redeVersaoModulo)) { | ||
977 | + $redeVersaoModulo = new RedeVersaoModulo(null, null, null, null, null, $rede); | ||
978 | + } | ||
979 | + | ||
980 | + // Adicione o restante dos atributos | ||
981 | + $redeVersaoModulo->setNmModulo($value['name']); | ||
982 | + $redeVersaoModulo->setTeVersaoModulo($value['versao']); | ||
983 | + $redeVersaoModulo->setDtAtualizacao(new \DateTime('NOW')); | ||
984 | + $redeVersaoModulo->setCsTipoSo( $value['tipoSo'] ); | ||
985 | + $redeVersaoModulo->setTeHash($value['hash']); | ||
986 | + $redeVersaoModulo->setTipo('cacic'); | ||
987 | + | ||
988 | + $em->persist($redeVersaoModulo); | ||
989 | + $em->flush(); | ||
990 | + } else { | ||
991 | + $logger->error("Erro no envio dos módulos via FTP!\n".$arrResult[1]); | ||
992 | + return false; | ||
993 | + } | ||
994 | + } | ||
995 | + | ||
996 | + return true; | ||
997 | + } | ||
998 | + | ||
672 | } | 999 | } |
673 | \ No newline at end of file | 1000 | \ No newline at end of file |
src/Cacic/CommonBundle/DataFixtures/ORM/LoadGrupoUsuarioData.php
@@ -36,11 +36,56 @@ class LoadGrupoUsuarioData extends AbstractFixture implements FixtureInterface, | @@ -36,11 +36,56 @@ class LoadGrupoUsuarioData extends AbstractFixture implements FixtureInterface, | ||
36 | $grupoAdmin->setTeMenuGrupo('menu_adm.txt'); | 36 | $grupoAdmin->setTeMenuGrupo('menu_adm.txt'); |
37 | $grupoAdmin->setTeDescricaoGrupo('Acesso irrestrito'); | 37 | $grupoAdmin->setTeDescricaoGrupo('Acesso irrestrito'); |
38 | $grupoAdmin->setCsNivelAdministracao(true); | 38 | $grupoAdmin->setCsNivelAdministracao(true); |
39 | + $grupoAdmin->setRole('ROLE_ADMIN'); | ||
39 | 40 | ||
40 | // Adiciona referência ao Grupo que será usada depois | 41 | // Adiciona referência ao Grupo que será usada depois |
41 | $this->addReference('grupo-admin', $grupoAdmin); | 42 | $this->addReference('grupo-admin', $grupoAdmin); |
42 | 43 | ||
43 | $manager->persist($grupoAdmin); | 44 | $manager->persist($grupoAdmin); |
45 | + | ||
46 | + // Cria os outros grupos padrão do Cacic | ||
47 | + $grupo = new GrupoUsuario(); | ||
48 | + $grupo->setNmGrupoUsuarios('comum'); | ||
49 | + $grupo->setTeGrupoUsuarios('Comum'); | ||
50 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
51 | + $grupo->setTeDescricaoGrupo('Usuário limitado, sem acesso a informações confidenciais como Softwares Inventariados e Opções Administrativas como Forçar Coletas e Excluir Computadores. Poderá alterar sua própria senha.'); | ||
52 | + $grupo->setCsNivelAdministracao(2); | ||
53 | + $grupo->setRole('ROLE_USER'); | ||
54 | + | ||
55 | + $manager->persist($grupo); | ||
56 | + | ||
57 | + // Cria os outros grupos padrão do Cacic | ||
58 | + $grupo = new GrupoUsuario(); | ||
59 | + $grupo->setNmGrupoUsuarios('gestao'); | ||
60 | + $grupo->setTeGrupoUsuarios('Gestão Central'); | ||
61 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
62 | + $grupo->setTeDescricaoGrupo('Acesso de leitura em todas as opções.'); | ||
63 | + $grupo->setCsNivelAdministracao(3); | ||
64 | + $grupo->setRole('ROLE_GESTAO'); | ||
65 | + | ||
66 | + $manager->persist($grupo); | ||
67 | + | ||
68 | + // Cria os outros grupos padrão do Cacic | ||
69 | + $grupo = new GrupoUsuario(); | ||
70 | + $grupo->setNmGrupoUsuarios('supervisao'); | ||
71 | + $grupo->setTeGrupoUsuarios('Supervisão'); | ||
72 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
73 | + $grupo->setTeDescricaoGrupo('Manutenção de tabelas e acesso a todas as informações referentes à Localização.'); | ||
74 | + $grupo->setCsNivelAdministracao(4); | ||
75 | + $grupo->setRole('ROLE_SUPERVISAO'); | ||
76 | + | ||
77 | + $manager->persist($grupo); | ||
78 | + | ||
79 | + | ||
80 | + // Cria os outros grupos padrão do Cacic | ||
81 | + $grupo = new GrupoUsuario(); | ||
82 | + $grupo->setNmGrupoUsuarios('tecnico'); | ||
83 | + $grupo->setTeGrupoUsuarios('Técnico'); | ||
84 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
85 | + $grupo->setTeDescricaoGrupo('Acesso técnico. Será permitido acessar configurações de rede e relatórios de Patrimônio e Hardware.'); | ||
86 | + $grupo->setCsNivelAdministracao(5); | ||
87 | + $grupo->setRole('ROLE_TECNICO'); | ||
88 | + | ||
44 | $manager->flush(); | 89 | $manager->flush(); |
45 | 90 | ||
46 | } | 91 | } |
src/Cacic/CommonBundle/DoctrineMigrations/Version20141018220727.php
0 → 100644
@@ -0,0 +1,109 @@ | @@ -0,0 +1,109 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace Cacic\CommonBundle\Migrations; | ||
4 | + | ||
5 | +use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
6 | +use Symfony\Component\DependencyInjection\ContainerInterface; | ||
7 | +use Doctrine\DBAL\Migrations\AbstractMigration; | ||
8 | +use Doctrine\DBAL\Schema\Schema; | ||
9 | +use Cacic\CommonBundle\Entity\GrupoUsuario; | ||
10 | + | ||
11 | +/** | ||
12 | + * Auto-generated Migration: Please modify to your needs! | ||
13 | + */ | ||
14 | +class Version20141018220727 extends AbstractMigration implements ContainerAwareInterface | ||
15 | +{ | ||
16 | + private $container; | ||
17 | + | ||
18 | + public function setContainer(ContainerInterface $container = null) | ||
19 | + { | ||
20 | + $this->container = $container; | ||
21 | + } | ||
22 | + | ||
23 | + public function up(Schema $schema) | ||
24 | + { | ||
25 | + // this up() migration is auto-generated, please modify it to your needs | ||
26 | + $logger = $this->container->get('logger'); | ||
27 | + $em = $this->container->get('doctrine.orm.entity_manager'); | ||
28 | + | ||
29 | + $grupoAdmin = $em->getRepository('CacicCommonBundle:GrupoUsuario')->findOneBy(array( | ||
30 | + 'nmGrupoUsuarios' => 'Admin' | ||
31 | + )); | ||
32 | + | ||
33 | + if (empty($grupoAdmin)) { | ||
34 | + // Cria pelo menos um grupo de administradores | ||
35 | + $grupoAdmin = new GrupoUsuario(); | ||
36 | + $grupoAdmin->setNmGrupoUsuarios('Admin'); | ||
37 | + $grupoAdmin->setTeGrupoUsuarios('Administradores'); | ||
38 | + $grupoAdmin->setTeMenuGrupo('menu_adm.txt'); | ||
39 | + $grupoAdmin->setTeDescricaoGrupo('Acesso irrestrito'); | ||
40 | + $grupoAdmin->setRole('ROLE_ADMIN'); | ||
41 | + $grupoAdmin->setCsNivelAdministracao(true); | ||
42 | + | ||
43 | + $em->persist($grupoAdmin); | ||
44 | + } | ||
45 | + | ||
46 | + // A melhor solução é adicionar todos os usuários no Grupo de Administradores | ||
47 | + $usuario_list = $em->getRepository('CacicCommonBundle:Usuario')->findAll(); | ||
48 | + foreach ($usuario_list as $usuario) { | ||
49 | + $usuario->setIdGrupoUsuario($grupoAdmin); | ||
50 | + | ||
51 | + $em->persist($usuario); | ||
52 | + } | ||
53 | + | ||
54 | + // Cria os outros grupos padrão do Cacic | ||
55 | + $grupo = new GrupoUsuario(); | ||
56 | + $grupo->setNmGrupoUsuarios('comum'); | ||
57 | + $grupo->setTeGrupoUsuarios('Comum'); | ||
58 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
59 | + $grupo->setTeDescricaoGrupo('Usuário limitado, sem acesso a informações confidenciais como Softwares Inventariados e Opções Administrativas como Forçar Coletas e Excluir Computadores. Poderá alterar sua própria senha.'); | ||
60 | + $grupo->setCsNivelAdministracao(2); | ||
61 | + $grupo->setRole('ROLE_USER'); | ||
62 | + | ||
63 | + $em->persist($grupo); | ||
64 | + | ||
65 | + // Cria os outros grupos padrão do Cacic | ||
66 | + $grupo = new GrupoUsuario(); | ||
67 | + $grupo->setNmGrupoUsuarios('gestao'); | ||
68 | + $grupo->setTeGrupoUsuarios('Gestão Central'); | ||
69 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
70 | + $grupo->setTeDescricaoGrupo('Acesso de leitura em todas as opções.'); | ||
71 | + $grupo->setCsNivelAdministracao(3); | ||
72 | + $grupo->setRole('ROLE_GESTAO'); | ||
73 | + | ||
74 | + $em->persist($grupo); | ||
75 | + | ||
76 | + // Cria os outros grupos padrão do Cacic | ||
77 | + $grupo = new GrupoUsuario(); | ||
78 | + $grupo->setNmGrupoUsuarios('supervisao'); | ||
79 | + $grupo->setTeGrupoUsuarios('Supervisão'); | ||
80 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
81 | + $grupo->setTeDescricaoGrupo('Manutenção de tabelas e acesso a todas as informações referentes à Localização.'); | ||
82 | + $grupo->setCsNivelAdministracao(4); | ||
83 | + $grupo->setRole('ROLE_SUPERVISAO'); | ||
84 | + | ||
85 | + $em->persist($grupo); | ||
86 | + | ||
87 | + | ||
88 | + // Cria os outros grupos padrão do Cacic | ||
89 | + $grupo = new GrupoUsuario(); | ||
90 | + $grupo->setNmGrupoUsuarios('tecnico'); | ||
91 | + $grupo->setTeGrupoUsuarios('Técnico'); | ||
92 | + $grupo->setTeMenuGrupo('menu_adm.txt'); | ||
93 | + $grupo->setTeDescricaoGrupo('Acesso técnico. Será permitido acessar configurações de rede e relatórios de Patrimônio e Hardware.'); | ||
94 | + $grupo->setCsNivelAdministracao(5); | ||
95 | + $grupo->setRole('ROLE_TECNICO'); | ||
96 | + | ||
97 | + $em->persist($grupo); | ||
98 | + | ||
99 | + // Grava tudo | ||
100 | + $em->flush(); | ||
101 | + | ||
102 | + } | ||
103 | + | ||
104 | + public function down(Schema $schema) | ||
105 | + { | ||
106 | + // this down() migration is auto-generated, please modify it to your needs | ||
107 | + | ||
108 | + } | ||
109 | +} |
src/Cacic/CommonBundle/Entity/GrupoUsuario.php
@@ -164,4 +164,32 @@ class GrupoUsuario | @@ -164,4 +164,32 @@ class GrupoUsuario | ||
164 | { | 164 | { |
165 | return $this->csNivelAdministracao; | 165 | return $this->csNivelAdministracao; |
166 | } | 166 | } |
167 | -} | ||
168 | \ No newline at end of file | 167 | \ No newline at end of file |
168 | + /** | ||
169 | + * @var string | ||
170 | + */ | ||
171 | + private $role; | ||
172 | + | ||
173 | + | ||
174 | + /** | ||
175 | + * Set role | ||
176 | + * | ||
177 | + * @param string $role | ||
178 | + * @return GrupoUsuario | ||
179 | + */ | ||
180 | + public function setRole($role) | ||
181 | + { | ||
182 | + $this->role = $role; | ||
183 | + | ||
184 | + return $this; | ||
185 | + } | ||
186 | + | ||
187 | + /** | ||
188 | + * Get role | ||
189 | + * | ||
190 | + * @return string | ||
191 | + */ | ||
192 | + public function getRole() | ||
193 | + { | ||
194 | + return $this->role; | ||
195 | + } | ||
196 | +} |
src/Cacic/CommonBundle/Entity/RedeVersaoModulo.php
@@ -211,4 +211,32 @@ class RedeVersaoModulo | @@ -211,4 +211,32 @@ class RedeVersaoModulo | ||
211 | } | 211 | } |
212 | 212 | ||
213 | 213 | ||
214 | -} | ||
215 | \ No newline at end of file | 214 | \ No newline at end of file |
215 | + /** | ||
216 | + * @var string | ||
217 | + */ | ||
218 | + private $tipo; | ||
219 | + | ||
220 | + | ||
221 | + /** | ||
222 | + * Set tipo | ||
223 | + * | ||
224 | + * @param string $tipo | ||
225 | + * @return RedeVersaoModulo | ||
226 | + */ | ||
227 | + public function setTipo($tipo) | ||
228 | + { | ||
229 | + $this->tipo = $tipo; | ||
230 | + | ||
231 | + return $this; | ||
232 | + } | ||
233 | + | ||
234 | + /** | ||
235 | + * Get tipo | ||
236 | + * | ||
237 | + * @return string | ||
238 | + */ | ||
239 | + public function getTipo() | ||
240 | + { | ||
241 | + return $this->tipo; | ||
242 | + } | ||
243 | +} |
src/Cacic/CommonBundle/Entity/Usuario.php
@@ -6,11 +6,13 @@ use Doctrine\ORM\Mapping as ORM; | @@ -6,11 +6,13 @@ use Doctrine\ORM\Mapping as ORM; | ||
6 | use Symfony\Component\Security\Core\User\UserInterface; | 6 | use Symfony\Component\Security\Core\User\UserInterface; |
7 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | 7 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
8 | use Symfony\Component\Security\Core\User\EquatableInterface; | 8 | use Symfony\Component\Security\Core\User\EquatableInterface; |
9 | +use Symfony\Component\Security\Core\User\AdvancedUserInterface; | ||
10 | +use Symfony\Component\Validator\Constraints\True; | ||
9 | 11 | ||
10 | /** | 12 | /** |
11 | * Usuario | 13 | * Usuario |
12 | */ | 14 | */ |
13 | -class Usuario implements UserInterface, \Serializable, EquatableInterface | 15 | +class Usuario implements AdvancedUserInterface, \Serializable, EquatableInterface |
14 | { | 16 | { |
15 | /** | 17 | /** |
16 | * @var integer | 18 | * @var integer |
@@ -381,7 +383,12 @@ class Usuario implements UserInterface, \Serializable, EquatableInterface | @@ -381,7 +383,12 @@ class Usuario implements UserInterface, \Serializable, EquatableInterface | ||
381 | */ | 383 | */ |
382 | public function getRoles() | 384 | public function getRoles() |
383 | { | 385 | { |
384 | - return array( 'ROLE_ADMIN' ); | 386 | + $role = $this->getIdGrupoUsuario()->getRole(); |
387 | + if (empty($role)) { | ||
388 | + return array( 'ROLE_USER' ); | ||
389 | + } else { | ||
390 | + return array( $role ); | ||
391 | + } | ||
385 | } | 392 | } |
386 | 393 | ||
387 | /** | 394 | /** |
@@ -538,4 +545,76 @@ class Usuario implements UserInterface, \Serializable, EquatableInterface | @@ -538,4 +545,76 @@ class Usuario implements UserInterface, \Serializable, EquatableInterface | ||
538 | return true; | 545 | return true; |
539 | } | 546 | } |
540 | 547 | ||
548 | + /** | ||
549 | + * Conta expirada | ||
550 | + * | ||
551 | + * @return bool | ||
552 | + */ | ||
553 | + public function isAccountNonExpired() | ||
554 | + { | ||
555 | + return true; | ||
556 | + } | ||
557 | + | ||
558 | + /** | ||
559 | + * Conta travada | ||
560 | + * | ||
561 | + * @return bool | ||
562 | + */ | ||
563 | + public function isAccountNonLocked() | ||
564 | + { | ||
565 | + return true; | ||
566 | + } | ||
567 | + | ||
568 | + /** | ||
569 | + * Credenciais expiradas | ||
570 | + * | ||
571 | + * @return bool | ||
572 | + */ | ||
573 | + public function isCredentialsNonExpired() | ||
574 | + { | ||
575 | + return true; | ||
576 | + } | ||
577 | + | ||
578 | + /** | ||
579 | + * Usuário ativo | ||
580 | + * | ||
581 | + * @return bool | ||
582 | + */ | ||
583 | + public function isEnabled() | ||
584 | + { | ||
585 | + return true; | ||
586 | + //return $this->isActive; | ||
587 | + } | ||
588 | + | ||
589 | + /** | ||
590 | + * FIXME: Criar interface para ativar e desativar usuários | ||
591 | + * | ||
592 | + * @var boolean | ||
593 | + */ | ||
594 | + private $isActive; | ||
595 | + | ||
596 | + | ||
597 | + /** | ||
598 | + * Set isActive | ||
599 | + * | ||
600 | + * @param boolean $isActive | ||
601 | + * @return Usuario | ||
602 | + */ | ||
603 | + public function setIsActive($isActive) | ||
604 | + { | ||
605 | + $this->isActive = $isActive; | ||
606 | + | ||
607 | + return $this; | ||
608 | + } | ||
609 | + | ||
610 | + /** | ||
611 | + * Get isActive | ||
612 | + * | ||
613 | + * @return boolean | ||
614 | + */ | ||
615 | + public function getIsActive() | ||
616 | + { | ||
617 | + return true; | ||
618 | + //return $this->isActive; | ||
619 | + } | ||
541 | } | 620 | } |
src/Cacic/CommonBundle/Entity/UsuarioRepository.php
@@ -34,13 +34,13 @@ class UsuarioRepository extends EntityRepository | @@ -34,13 +34,13 @@ class UsuarioRepository extends EntityRepository | ||
34 | * Método que apresenta o grupo de acesso do respectivo usuario | 34 | * Método que apresenta o grupo de acesso do respectivo usuario |
35 | */ | 35 | */ |
36 | public function nivel($usuario){ | 36 | public function nivel($usuario){ |
37 | - $_dql = "SELECT g.teGrupoUsuarios | 37 | + $_dql = "SELECT g.nmGrupoUsuarios |
38 | FROM CacicCommonBundle:Usuario u | 38 | FROM CacicCommonBundle:Usuario u |
39 | JOIN u.idLocal l | 39 | JOIN u.idLocal l |
40 | JOIN u.idGrupoUsuario g | 40 | JOIN u.idGrupoUsuario g |
41 | LEFT JOIN u.locaisSecundarios ls | 41 | LEFT JOIN u.locaisSecundarios ls |
42 | WHERE u.idUsuario = :idUsuario | 42 | WHERE u.idUsuario = :idUsuario |
43 | - GROUP BY g.teGrupoUsuarios"; | 43 | + GROUP BY g.nmGrupoUsuarios"; |
44 | 44 | ||
45 | return $this->getEntityManager() | 45 | return $this->getEntityManager() |
46 | ->createQuery( $_dql ) | 46 | ->createQuery( $_dql ) |
@@ -0,0 +1,62 @@ | @@ -0,0 +1,62 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: eduardo | ||
5 | + * Date: 18/10/14 | ||
6 | + * Time: 23:36 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace Cacic\CommonBundle\Form\Type; | ||
10 | + | ||
11 | +use Symfony\Component\Form\AbstractType; | ||
12 | +use Symfony\Component\Form\FormBuilderInterface; | ||
13 | + | ||
14 | +/** | ||
15 | + * Formulário para upload dos agentes | ||
16 | + * | ||
17 | + * Class AgenteType | ||
18 | + * @package Cacic\CommonBundle\Form\Type | ||
19 | + */ | ||
20 | +class AgenteType extends AbstractType { | ||
21 | + | ||
22 | + /** | ||
23 | + * Nome do Formulário | ||
24 | + * @return string | ||
25 | + */ | ||
26 | + | ||
27 | + public function getName() { | ||
28 | + return 'agentes'; | ||
29 | + } | ||
30 | + | ||
31 | + public function buildForm( FormBuilderInterface $builder, array $options ) | ||
32 | + { | ||
33 | + $builder->add('windows_version', 'text', | ||
34 | + array( | ||
35 | + 'label' => 'Versão dos Agentes Windows', | ||
36 | + 'required' => false | ||
37 | + ) | ||
38 | + ); | ||
39 | + | ||
40 | + $builder->add('windows', 'file', | ||
41 | + array( | ||
42 | + 'label' => 'Agentes Windows', | ||
43 | + 'required' => false | ||
44 | + ) | ||
45 | + ); | ||
46 | + | ||
47 | + $builder->add('linux_version', 'text', | ||
48 | + array( | ||
49 | + 'label' => 'Versão dos Agentes Linux', | ||
50 | + 'required' => false | ||
51 | + ) | ||
52 | + ); | ||
53 | + | ||
54 | + $builder->add('linux', 'file', | ||
55 | + array( | ||
56 | + 'label' => 'Agentes Linux', | ||
57 | + 'required' => false | ||
58 | + ) | ||
59 | + ); | ||
60 | + } | ||
61 | + | ||
62 | +} | ||
0 | \ No newline at end of file | 63 | \ No newline at end of file |
@@ -0,0 +1,43 @@ | @@ -0,0 +1,43 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: eduardo | ||
5 | + * Date: 18/10/14 | ||
6 | + * Time: 23:36 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace Cacic\CommonBundle\Form\Type; | ||
10 | + | ||
11 | +use Symfony\Component\Form\AbstractType; | ||
12 | +use Symfony\Component\Form\FormBuilderInterface; | ||
13 | + | ||
14 | +/** | ||
15 | + * Formulário para upload dos agentes | ||
16 | + * | ||
17 | + * Class AgenteType | ||
18 | + * @package Cacic\CommonBundle\Form\Type | ||
19 | + */ | ||
20 | +class DeployType extends AbstractType { | ||
21 | + | ||
22 | + /** | ||
23 | + * Nome do Formulário | ||
24 | + * @return string | ||
25 | + */ | ||
26 | + | ||
27 | + public function getName() { | ||
28 | + return 'deploy'; | ||
29 | + } | ||
30 | + | ||
31 | + public function buildForm( FormBuilderInterface $builder, array $options ) | ||
32 | + { | ||
33 | + | ||
34 | + $builder->add('outros', 'file', | ||
35 | + array( | ||
36 | + 'label' => 'Software para Deploy', | ||
37 | + 'required' => false | ||
38 | + ) | ||
39 | + ); | ||
40 | + | ||
41 | + } | ||
42 | + | ||
43 | +} | ||
0 | \ No newline at end of file | 44 | \ No newline at end of file |
src/Cacic/CommonBundle/Resources/config/doctrine/GrupoUsuario.orm.yml
@@ -34,4 +34,8 @@ Cacic\CommonBundle\Entity\GrupoUsuario: | @@ -34,4 +34,8 @@ Cacic\CommonBundle\Entity\GrupoUsuario: | ||
34 | type: integer | 34 | type: integer |
35 | nullable: true | 35 | nullable: true |
36 | column: cs_nivel_administracao | 36 | column: cs_nivel_administracao |
37 | + role: | ||
38 | + type: text | ||
39 | + nullable: true | ||
40 | + column: role | ||
37 | lifecycleCallbacks: { } | 41 | lifecycleCallbacks: { } |
src/Cacic/CommonBundle/Resources/config/doctrine/RedeVersaoModulo.orm.yml
@@ -35,6 +35,11 @@ Cacic\CommonBundle\Entity\RedeVersaoModulo: | @@ -35,6 +35,11 @@ Cacic\CommonBundle\Entity\RedeVersaoModulo: | ||
35 | fixed: false | 35 | fixed: false |
36 | nullable: true | 36 | nullable: true |
37 | column: te_hash | 37 | column: te_hash |
38 | + tipo: | ||
39 | + type: text | ||
40 | + fixed: false | ||
41 | + nullable: true | ||
42 | + column: tipo | ||
38 | manyToOne: | 43 | manyToOne: |
39 | idRede: | 44 | idRede: |
40 | targetEntity: Rede | 45 | targetEntity: Rede |
src/Cacic/CommonBundle/Resources/config/doctrine/Usuario.orm.yml
@@ -60,6 +60,11 @@ Cacic\CommonBundle\Entity\Usuario: | @@ -60,6 +60,11 @@ Cacic\CommonBundle\Entity\Usuario: | ||
60 | fixed: false | 60 | fixed: false |
61 | nullable: true | 61 | nullable: true |
62 | column: crypt_key | 62 | column: crypt_key |
63 | + isActive: | ||
64 | + type: boolean | ||
65 | + fixed: false | ||
66 | + nullable: true | ||
67 | + column: is_active | ||
63 | manyToMany: | 68 | manyToMany: |
64 | locaisSecundarios: | 69 | locaisSecundarios: |
65 | targetEntity: Local | 70 | targetEntity: Local |
src/Cacic/CommonBundle/Resources/config/routing.yml
@@ -16,392 +16,482 @@ cacic_common_instalador: | @@ -16,392 +16,482 @@ cacic_common_instalador: | ||
16 | pattern: /instalador | 16 | pattern: /instalador |
17 | defaults: { _controller: CacicCommonBundle:Instalador:index } | 17 | defaults: { _controller: CacicCommonBundle:Instalador:index } |
18 | 18 | ||
19 | +########################################### | ||
20 | +# INÍCIO: Páginas restritas aos administradores | ||
21 | +############################################# | ||
22 | + | ||
23 | +# Usuários | ||
24 | + | ||
19 | cacic_usuario_index: | 25 | cacic_usuario_index: |
20 | - pattern: /usuarios/{page} | 26 | + pattern: /admin/usuarios/{page} |
21 | defaults: { _controller: CacicCommonBundle:Usuario:index, page: 1 } | 27 | defaults: { _controller: CacicCommonBundle:Usuario:index, page: 1 } |
22 | requirements: | 28 | requirements: |
23 | page: \d+ | 29 | page: \d+ |
24 | 30 | ||
25 | -cacic_usuario_meus_dados: | ||
26 | - pattern: /usuario/meusdados | ||
27 | - defaults: { _controller: CacicCommonBundle:Usuario:meusdados} | ||
28 | - | ||
29 | -cacic_usuario_trocar_senha: | ||
30 | - pattern: /usuario/trocarsenha | ||
31 | - defaults: { _controller: CacicCommonBundle:Usuario:trocarsenha} | ||
32 | - | ||
33 | -cacic_usuario_trocar_propria_senha: | ||
34 | - pattern: /usuario/trocarpropriasenha | ||
35 | - defaults: { _controller: CacicCommonBundle:Usuario:trocarpropriasenha} | ||
36 | - | ||
37 | cacic_usuario_cadastrar: | 31 | cacic_usuario_cadastrar: |
38 | - pattern: /usuario/cadastrar | 32 | + pattern: /admin/usuario/cadastrar |
39 | defaults: { _controller: CacicCommonBundle:Usuario:cadastrar} | 33 | defaults: { _controller: CacicCommonBundle:Usuario:cadastrar} |
40 | 34 | ||
41 | cacic_usuario_editar: | 35 | cacic_usuario_editar: |
42 | - pattern: /usuario/editar/{idUsuario} | 36 | + pattern: /admin/usuario/editar/{idUsuario} |
43 | defaults: { _controller: CacicCommonBundle:Usuario:editar, idUsuario: null} | 37 | defaults: { _controller: CacicCommonBundle:Usuario:editar, idUsuario: null} |
44 | requirements: | 38 | requirements: |
45 | idUsuario: \d+ | 39 | idUsuario: \d+ |
46 | 40 | ||
47 | cacic_usuario_excluir: | 41 | cacic_usuario_excluir: |
48 | - pattern: /usuario/excluir | 42 | + pattern: /admin/usuario/excluir |
49 | defaults: { _controller: CacicCommonBundle:Usuario:excluir} | 43 | defaults: { _controller: CacicCommonBundle:Usuario:excluir} |
50 | 44 | ||
51 | - | ||
52 | -cacic_usuario_recuperar_senha: | ||
53 | - pattern: /usuario/recuperarsenha | ||
54 | - defaults: { _controller: CacicCommonBundle:Usuario:recuperarsenha} | 45 | +# Locais |
55 | 46 | ||
56 | cacic_local_index: | 47 | cacic_local_index: |
57 | - pattern: /local/{page} | 48 | + pattern: /admin/local/{page} |
58 | defaults: { _controller: CacicCommonBundle:Local:index, page: 1 } | 49 | defaults: { _controller: CacicCommonBundle:Local:index, page: 1 } |
59 | requirements: | 50 | requirements: |
60 | page: \d+ | 51 | page: \d+ |
61 | 52 | ||
62 | cacic_local_cadastrar: | 53 | cacic_local_cadastrar: |
63 | - pattern: /local/cadastrar | 54 | + pattern: /admin/local/cadastrar |
64 | defaults: { _controller: CacicCommonBundle:Local:cadastrar} | 55 | defaults: { _controller: CacicCommonBundle:Local:cadastrar} |
65 | 56 | ||
66 | cacic_local_editar: | 57 | cacic_local_editar: |
67 | - pattern: /local/editar/{idLocal} | 58 | + pattern: /admin/local/editar/{idLocal} |
68 | defaults: { _controller: CacicCommonBundle:Local:editar} | 59 | defaults: { _controller: CacicCommonBundle:Local:editar} |
69 | requirements: | 60 | requirements: |
70 | idLocal: \d+ | 61 | idLocal: \d+ |
71 | 62 | ||
72 | cacic_local_excluir: | 63 | cacic_local_excluir: |
73 | - pattern: /local/excluir | 64 | + pattern: /admin/local/excluir |
74 | defaults: { _controller: CacicCommonBundle:Local:excluir} | 65 | defaults: { _controller: CacicCommonBundle:Local:excluir} |
75 | 66 | ||
76 | cacic_local_redesassociadas: | 67 | cacic_local_redesassociadas: |
77 | - pattern: /local/redes/{idLocal} | 68 | + pattern: /admin/local/redes/{idLocal} |
78 | defaults: { _controller: CacicCommonBundle:Local:redes} | 69 | defaults: { _controller: CacicCommonBundle:Local:redes} |
79 | requirements: | 70 | requirements: |
80 | idLocal: \d+ | 71 | idLocal: \d+ |
81 | 72 | ||
82 | cacic_local_usuariosassociados: | 73 | cacic_local_usuariosassociados: |
83 | - pattern: /local/usuarios/{idLocal} | 74 | + pattern: /admin/local/usuarios/{idLocal} |
84 | defaults: { _controller: CacicCommonBundle:Local:usuarios} | 75 | defaults: { _controller: CacicCommonBundle:Local:usuarios} |
85 | requirements: | 76 | requirements: |
86 | idLocal: \d+ | 77 | idLocal: \d+ |
87 | 78 | ||
88 | cacic_local_configuracoes: | 79 | cacic_local_configuracoes: |
89 | - pattern: /local/configuracoes/{idLocal} | 80 | + pattern: /admin/local/configuracoes/{idLocal} |
90 | defaults: { _controller: CacicCommonBundle:Local:configuracoes} | 81 | defaults: { _controller: CacicCommonBundle:Local:configuracoes} |
91 | requirements: | 82 | requirements: |
92 | idLocal: \d+ | 83 | idLocal: \d+ |
93 | 84 | ||
94 | cacic_servidorautenticacao_index: | 85 | cacic_servidorautenticacao_index: |
95 | - pattern: /servidorautenticacao/{page} | 86 | + pattern: /admin/servidorautenticacao/{page} |
96 | defaults: {_controller: CacicCommonBundle:ServidorAutenticacao:index, page: 1 } | 87 | defaults: {_controller: CacicCommonBundle:ServidorAutenticacao:index, page: 1 } |
97 | requirements: | 88 | requirements: |
98 | page: \d+ | 89 | page: \d+ |
99 | 90 | ||
100 | cacic_servidorautenticacao_cadastrar: | 91 | cacic_servidorautenticacao_cadastrar: |
101 | - pattern: /servidorautenticacao/cadastrar | 92 | + pattern: /admin/servidorautenticacao/cadastrar |
102 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:cadastrar} | 93 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:cadastrar} |
103 | 94 | ||
104 | cacic_servidorautenticacao_editar: | 95 | cacic_servidorautenticacao_editar: |
105 | - pattern: /servidorautenticacao/editar/{idServidorAutenticacao} | 96 | + pattern: /admin/servidorautenticacao/editar/{idServidorAutenticacao} |
106 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:editar} | 97 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:editar} |
107 | requirements: | 98 | requirements: |
108 | idLocal: \d+ | 99 | idLocal: \d+ |
109 | 100 | ||
110 | cacic_servidorautenticacao_excluir: | 101 | cacic_servidorautenticacao_excluir: |
111 | - pattern: /servidorautenticacao/excluir | 102 | + pattern: /admin/servidorautenticacao/excluir |
112 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:excluir} | 103 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:excluir} |
113 | 104 | ||
114 | cacic_servidorautenticacao_redesassociadas: | 105 | cacic_servidorautenticacao_redesassociadas: |
115 | - pattern: /servidorautenticacao/redes/{idServidorAutenticacao} | 106 | + pattern: /admin/servidorautenticacao/redes/{idServidorAutenticacao} |
116 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:redes} | 107 | defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:redes} |
117 | requirements: | 108 | requirements: |
118 | idLocal: \d+ | 109 | idLocal: \d+ |
119 | 110 | ||
111 | +# Subredes | ||
112 | + | ||
120 | cacic_subrede_index: | 113 | cacic_subrede_index: |
121 | - pattern: /subrede/{page} | 114 | + pattern: /admin/subrede/{page} |
122 | defaults: {_controller: CacicCommonBundle:Rede:index, page: 1 } | 115 | defaults: {_controller: CacicCommonBundle:Rede:index, page: 1 } |
123 | requirements: | 116 | requirements: |
124 | page: \d+ | 117 | page: \d+ |
125 | 118 | ||
126 | cacic_subrede_cadastrar: | 119 | cacic_subrede_cadastrar: |
127 | - pattern: /subrede/cadastrar | 120 | + pattern: /admin/subrede/cadastrar |
128 | defaults: { _controller: CacicCommonBundle:Rede:cadastrar} | 121 | defaults: { _controller: CacicCommonBundle:Rede:cadastrar} |
129 | 122 | ||
130 | cacic_subrede_editar: | 123 | cacic_subrede_editar: |
131 | - pattern: /subrede/editar/{idRede} | 124 | + pattern: /admin/subrede/editar/{idRede} |
132 | defaults: { _controller: CacicCommonBundle:Rede:editar} | 125 | defaults: { _controller: CacicCommonBundle:Rede:editar} |
133 | requirements: | 126 | requirements: |
134 | idRede: \d+ | 127 | idRede: \d+ |
135 | 128 | ||
136 | cacic_subrede_excluir: | 129 | cacic_subrede_excluir: |
137 | - pattern: /subrede/excluir | 130 | + pattern: /admin/subrede/excluir |
138 | defaults: { _controller: CacicCommonBundle:Rede:excluir} | 131 | defaults: { _controller: CacicCommonBundle:Rede:excluir} |
139 | 132 | ||
140 | cacic_subrede_manutencao: | 133 | cacic_subrede_manutencao: |
141 | - pattern: /subrede/manutencao | 134 | + pattern: /admin/subrede/manutencao |
142 | defaults: { _controller: CacicCommonBundle:Rede:manutencao} | 135 | defaults: { _controller: CacicCommonBundle:Rede:manutencao} |
143 | 136 | ||
144 | cacic_subrede_vincular: | 137 | cacic_subrede_vincular: |
145 | - pattern: /subrede/vincular | 138 | + pattern: /admin/subrede/vincular |
146 | defaults: { _controller: CacicCommonBundle:Rede:vincular} | 139 | defaults: { _controller: CacicCommonBundle:Rede:vincular} |
147 | 140 | ||
148 | cacic_subrede_computadores: | 141 | cacic_subrede_computadores: |
149 | - pattern: /subrede/computadores | 142 | + pattern: /admin/subrede/computadores |
150 | defaults: { _controller: CacicCommonBundle:Rede:computadores} | 143 | defaults: { _controller: CacicCommonBundle:Rede:computadores} |
151 | 144 | ||
145 | +cacic_configuracao_padrao: | ||
146 | + pattern: /admin/configuracao/padrao | ||
147 | + defaults: { _controller: CacicCommonBundle:Configuracao:padrao} | ||
148 | + | ||
149 | +cacic_configuracao_gerente: | ||
150 | + pattern: /admin/configuracao/gerente | ||
151 | + defaults: { _controller: CacicCommonBundle:Configuracao:gerente} | ||
152 | + | ||
153 | +cacic_configuracao_agente: | ||
154 | + pattern: /admin/configuracao/agente | ||
155 | + defaults: { _controller: CacicCommonBundle:Configuracao:agente} | ||
156 | + | ||
157 | +cacic_configuracao_salvar: | ||
158 | + pattern: /admin/configuracao/salvar | ||
159 | + defaults: { _controller: CacicCommonBundle:Configuracao:salvarconfiguracao} | ||
160 | + | ||
161 | +cacic_modulo_index: | ||
162 | + pattern: /admin/modulo | ||
163 | + defaults: { _controller: CacicCommonBundle:Modulo:index} | ||
164 | + | ||
165 | +cacic_modulo_editar: | ||
166 | + pattern: /admin/modulo/editar/{idAcao} | ||
167 | + defaults: { _controller: CacicCommonBundle:Modulo:editar} | ||
168 | + | ||
169 | +cacic_log_acesso: | ||
170 | + pattern: /admin/log/acesso | ||
171 | + defaults: { _controller: CacicCommonBundle:Log:acesso} | ||
172 | + | ||
173 | +cacic_log_pesquisa: | ||
174 | + pattern: /admin/log/pesquisa | ||
175 | + defaults: { _controller: CacicCommonBundle:Log:pesquisa} | ||
176 | + | ||
177 | +cacic_log_atividade: | ||
178 | + pattern: /admin/log/atividade | ||
179 | + defaults: { _controller: CacicCommonBundle:Log:atividade} | ||
180 | + | ||
181 | +cacic_log_insucesso_instalacao: | ||
182 | + pattern: /admin/log/insucessoinstalacao | ||
183 | + defaults: { _controller: CacicCommonBundle:Log:insucessoinstalacao} | ||
184 | + | ||
185 | +cacic_log_suporte_remoto: | ||
186 | + pattern: /admin/log/suporteremoto | ||
187 | + defaults: { _controller: CacicCommonBundle:Log:suporteremoto} | ||
188 | + | ||
189 | +cacic_patrimonio_index: | ||
190 | + pattern: /admin/patrimonio/index | ||
191 | + defaults: { _controller: CacicCommonBundle:PatrimonioConfigInterface:index} | ||
192 | + | ||
193 | +cacic_patrimonio_interface: | ||
194 | + pattern: /admin/patrimonio/interface/{idEtiqueta} | ||
195 | + defaults: { _controller: CacicCommonBundle:PatrimonioConfigInterface:interface} | ||
196 | + | ||
197 | +cacic_patrimonio_opcoes: | ||
198 | + pattern: /admin/patrimonio/opcoes | ||
199 | + defaults: { _controller: CacicCommonBundle:PatrimonioConfigInterface:opcoes} | ||
200 | + | ||
201 | +cacic_uorg_index: | ||
202 | + pattern: /admin/uorg/index | ||
203 | + defaults: { _controller: CacicCommonBundle:Uorg:index} | ||
204 | + | ||
205 | +cacic_uorg_cadastrar: | ||
206 | + pattern: /admin/uorg/cadastrar/{idUorgPai} | ||
207 | + defaults: { _controller: CacicCommonBundle:Uorg:cadastrar, idUorgPai: null} | ||
208 | + requirements: | ||
209 | + idUorgPai: \d+ | ||
210 | + | ||
211 | +cacic_uorg_editar: | ||
212 | + pattern: /admin/uorg/editar/{idUorg} | ||
213 | + defaults: { _controller: CacicCommonBundle:Uorg:editar, idUorg: null} | ||
214 | + requirements: | ||
215 | + idUorg: \d+ | ||
216 | + | ||
217 | +cacic_uorg_excluir: | ||
218 | + pattern: /admin/uorg/excluir/{idUorg} | ||
219 | + defaults: { _controller: CacicCommonBundle:Uorg:excluir, idUorg: null} | ||
220 | + requirements: | ||
221 | + idUorg: \d+ | ||
222 | + | ||
223 | +cacic_uorg_loadnodes: | ||
224 | + pattern: /admin/uorg/loadnodes/{idUorgPai} | ||
225 | + defaults: { _controller: CacicCommonBundle:Uorg:loadnodes, idUorgPai: null} | ||
226 | + requirements: | ||
227 | + idUorgPai: \d+ | ||
228 | + | ||
229 | +cacic_uorg_visualizar: | ||
230 | + pattern: /admin/uorg/visualizar/{idUorg} | ||
231 | + defaults: { _controller: CacicCommonBundle:Uorg:visualizar, idUorg: null} | ||
232 | + requirements: | ||
233 | + idUorg: \d+ | ||
234 | + | ||
235 | +cacic_computador_excluir: | ||
236 | + pattern: /admin/computador/excluir/{idComputador} | ||
237 | + defaults: { _controller: CacicCommonBundle:Computador:excluir} | ||
238 | + requirements: | ||
239 | + idComputador: \d+ | ||
240 | + | ||
241 | +cacic_computador_coletar: | ||
242 | + pattern: /admin/computador/coletar | ||
243 | + defaults: { _controller: CacicCommonBundle:Computador:coletar } | ||
244 | + | ||
245 | +cacic_computador_versaoagente: | ||
246 | + pattern: /admin/computador/versaoagente | ||
247 | + defaults: { _controller: CacicCommonBundle:Computador:versaoagente } | ||
248 | + | ||
249 | +cacic_rede_coletar: | ||
250 | + pattern: /admin/rede/coletar | ||
251 | + defaults: { _controller: CacicCommonBundle:Rede:coletar } | ||
252 | + | ||
253 | +cacic_rede_coletar_submit: | ||
254 | + pattern: /admin/rede/coletar/submit | ||
255 | + defaults: { _controller: CacicCommonBundle:Rede:submit } | ||
256 | + | ||
257 | +cacic_computador_update: | ||
258 | + pattern: /admin/computador/update/{idComputador} | ||
259 | + defaults: { _controller: CacicCommonBundle:Computador:update, idComputador: null } | ||
260 | + | ||
261 | +cacic_migracao_cacic26: | ||
262 | + pattern: /admin/migracao/cacic26 | ||
263 | + defaults: { _controller: CacicCommonBundle:Cacic26:importardados} | ||
264 | + | ||
265 | +cacic_migracao_importador: | ||
266 | + pattern: /admin/migracao/importador | ||
267 | + defaults: { _controller: CacicCommonBundle:Cacic26:importarscript} | ||
268 | + | ||
269 | +cacic_uorg_type_index: | ||
270 | + pattern: /admin/uorg/type/{page} | ||
271 | + defaults: { _controller: CacicCommonBundle:UorgType:index, page: 1 } | ||
272 | + requirements: | ||
273 | + page: \d+ | ||
274 | + | ||
275 | +cacic_uorg_type_cadastrar: | ||
276 | + pattern: /admin/uorg/type/cadastrar/{idUorgType} | ||
277 | + defaults: { _controller: CacicCommonBundle:UorgType:cadastrar, idUorgType: null} | ||
278 | + | ||
279 | +cacic_uorg_type_excluir: | ||
280 | + pattern: /admin/uorg/type/excluir | ||
281 | + defaults: { _controller: CacicCommonBundle:UorgType:excluir} | ||
282 | + | ||
283 | +cacic_grupo_usuario_index: | ||
284 | + pattern: /admin/grupousuario/{page} | ||
285 | + defaults: { _controller: CacicCommonBundle:GrupoUsuario:index, page: 1 } | ||
286 | + requirements: | ||
287 | + page: \d+ | ||
288 | + | ||
289 | +cacic_grupo_usuario_cadastrar: | ||
290 | + pattern: /admin/grupousuario/cadastrar | ||
291 | + defaults: { _controller: CacicCommonBundle:GrupoUsuario:cadastrar} | ||
292 | + | ||
293 | +cacic_grupo_usuario_editar: | ||
294 | + pattern: /admin/grupousuario/editar/{idGrupoUsuario} | ||
295 | + defaults: { _controller: CacicCommonBundle:GrupoUsuario:editar} | ||
296 | + requirements: | ||
297 | + idGrupoUsuario: \d+ | ||
298 | + | ||
299 | +cacic_grupo_usuario_excluir: | ||
300 | + pattern: /admin/grupousuario/excluir | ||
301 | + defaults: { _controller: CacicCommonBundle:GrupoUsuario:excluir} | ||
302 | + | ||
303 | +cacic_ateste: | ||
304 | + pattern: /admin/ateste/ | ||
305 | + defaults: { _controller: CacicCommonBundle:Ateste:index } | ||
306 | + | ||
307 | +cacic_agente: | ||
308 | + pattern: /admin/agente/ | ||
309 | + defaults: { _controller: CacicCommonBundle:Agente:index } | ||
310 | + | ||
311 | +cacic_agente_excluir: | ||
312 | + pattern: /admin/agente/excluir | ||
313 | + defaults: { _controller: CacicCommonBundle:Agente:excluir } | ||
314 | + | ||
315 | +cacic_deploy: | ||
316 | + pattern: /admin/deploy/ | ||
317 | + defaults: { _controller: CacicCommonBundle:Agente:deploy } | ||
318 | + | ||
319 | +cacic_atualizacao_subredes: | ||
320 | + pattern: /admin/subrede/manutencaoneo | ||
321 | + defaults: { _controller: CacicCommonBundle:Rede:manutencaoNeo } | ||
322 | + | ||
323 | +############################ | ||
324 | +# FIM: Páginas administrativas | ||
325 | +############################# | ||
326 | + | ||
327 | + | ||
328 | +############################################ | ||
329 | +# INÍCIO: Usuário com perfil manutenção | ||
330 | +############################################ | ||
331 | + | ||
152 | cacic_aplicativo_index: | 332 | cacic_aplicativo_index: |
153 | - pattern: /aplicativo/{page} | 333 | + pattern: /manutencao/aplicativo/{page} |
154 | defaults: {_controller: CacicCommonBundle:Aplicativo:index, page: 1 } | 334 | defaults: {_controller: CacicCommonBundle:Aplicativo:index, page: 1 } |
155 | requirements: | 335 | requirements: |
156 | page: \d+ | 336 | page: \d+ |
157 | 337 | ||
158 | cacic_aplicativo_cadastrar: | 338 | cacic_aplicativo_cadastrar: |
159 | - pattern: /aplicativo/cadastrar | 339 | + pattern: /manutencao/aplicativo/cadastrar |
160 | defaults: { _controller: CacicCommonBundle:Aplicativo:cadastrar} | 340 | defaults: { _controller: CacicCommonBundle:Aplicativo:cadastrar} |
161 | 341 | ||
162 | cacic_aplicativo_editar: | 342 | cacic_aplicativo_editar: |
163 | - pattern: /aplicativo/editar/{idAplicativo} | 343 | + pattern: /manutencao/aplicativo/editar/{idAplicativo} |
164 | defaults: { _controller: CacicCommonBundle:Aplicativo:editar} | 344 | defaults: { _controller: CacicCommonBundle:Aplicativo:editar} |
165 | requirements: | 345 | requirements: |
166 | idAplicativo: \d+ | 346 | idAplicativo: \d+ |
167 | 347 | ||
168 | cacic_aplicativo_excluir: | 348 | cacic_aplicativo_excluir: |
169 | - pattern: /aplicativo/excluir | 349 | + pattern: /manutencao/aplicativo/excluir |
170 | defaults: { _controller: CacicCommonBundle:Aplicativo:excluir} | 350 | defaults: { _controller: CacicCommonBundle:Aplicativo:excluir} |
171 | 351 | ||
172 | 352 | ||
173 | cacic_tiposoftware_index: | 353 | cacic_tiposoftware_index: |
174 | - pattern: /tiposoftware/{page} | 354 | + pattern: /manutencao/tiposoftware/{page} |
175 | defaults: {_controller: CacicCommonBundle:TipoSoftware:index, page: 1 } | 355 | defaults: {_controller: CacicCommonBundle:TipoSoftware:index, page: 1 } |
176 | requirements: | 356 | requirements: |
177 | page: \d+ | 357 | page: \d+ |
178 | 358 | ||
179 | cacic_tiposoftware_cadastrar: | 359 | cacic_tiposoftware_cadastrar: |
180 | - pattern: /tiposoftware/cadastrar | 360 | + pattern: /manutencao/tiposoftware/cadastrar |
181 | defaults: { _controller: CacicCommonBundle:TipoSoftware:cadastrar} | 361 | defaults: { _controller: CacicCommonBundle:TipoSoftware:cadastrar} |
182 | 362 | ||
183 | cacic_tiposoftware_editar: | 363 | cacic_tiposoftware_editar: |
184 | - pattern: /tiposoftware/editar/{idTipoSoftware} | 364 | + pattern: /manutencao/tiposoftware/editar/{idTipoSoftware} |
185 | defaults: { _controller: CacicCommonBundle:TipoSoftware:editar} | 365 | defaults: { _controller: CacicCommonBundle:TipoSoftware:editar} |
186 | requirements: | 366 | requirements: |
187 | idTipoSoftware: \d+ | 367 | idTipoSoftware: \d+ |
188 | 368 | ||
189 | cacic_tiposoftware_excluir: | 369 | cacic_tiposoftware_excluir: |
190 | - pattern: /tiposoftware/excluir | 370 | + pattern: /manutencao/tiposoftware/excluir |
191 | defaults: { _controller: CacicCommonBundle:TipoSoftware:excluir} | 371 | defaults: { _controller: CacicCommonBundle:TipoSoftware:excluir} |
192 | 372 | ||
193 | cacic_sistemaoperacional_index: | 373 | cacic_sistemaoperacional_index: |
194 | - pattern: /sistemaoperacional/{page} | 374 | + pattern: /manutencao/sistemaoperacional/{page} |
195 | defaults: {_controller: CacicCommonBundle:So:index, page: 1 } | 375 | defaults: {_controller: CacicCommonBundle:So:index, page: 1 } |
196 | requirements: | 376 | requirements: |
197 | page: \d+ | 377 | page: \d+ |
198 | 378 | ||
199 | cacic_sistemaoperacional_cadastrar: | 379 | cacic_sistemaoperacional_cadastrar: |
200 | - pattern: /sistemaoperacional/cadastrar | 380 | + pattern: /manutencao/sistemaoperacional/cadastrar |
201 | defaults: { _controller: CacicCommonBundle:So:cadastrar} | 381 | defaults: { _controller: CacicCommonBundle:So:cadastrar} |
202 | 382 | ||
203 | cacic_sistemaoperacional_editar: | 383 | cacic_sistemaoperacional_editar: |
204 | - pattern: /sistemaoperacional/editar/{idSo} | 384 | + pattern: /manutencao/sistemaoperacional/editar/{idSo} |
205 | defaults: { _controller: CacicCommonBundle:So:editar} | 385 | defaults: { _controller: CacicCommonBundle:So:editar} |
206 | requirements: | 386 | requirements: |
207 | idSo: \d+ | 387 | idSo: \d+ |
208 | 388 | ||
209 | cacic_sistemaoperacional_excluir: | 389 | cacic_sistemaoperacional_excluir: |
210 | - pattern: /sistemaoperacional/excluir | 390 | + pattern: /manutencao/sistemaoperacional/excluir |
211 | defaults: { _controller: CacicCommonBundle:So:excluir} | 391 | defaults: { _controller: CacicCommonBundle:So:excluir} |
212 | 392 | ||
213 | cacic_software_index: | 393 | cacic_software_index: |
214 | - pattern: /software/{page} | 394 | + pattern: /manutencao/software/{page} |
215 | defaults: {_controller: CacicCommonBundle:Software:index, page: 1 } | 395 | defaults: {_controller: CacicCommonBundle:Software:index, page: 1 } |
216 | requirements: | 396 | requirements: |
217 | page: \d+ | 397 | page: \d+ |
218 | 398 | ||
219 | cacic_software_cadastrar: | 399 | cacic_software_cadastrar: |
220 | - pattern: /software/cadastrar | 400 | + pattern: /manutencao/software/cadastrar |
221 | defaults: { _controller: CacicCommonBundle:Software:cadastrar} | 401 | defaults: { _controller: CacicCommonBundle:Software:cadastrar} |
222 | 402 | ||
223 | cacic_software_editar: | 403 | cacic_software_editar: |
224 | - pattern: /software/editar/{idSoftware} | 404 | + pattern: /manutencao/software/editar/{idSoftware} |
225 | defaults: { _controller: CacicCommonBundle:Software:editar} | 405 | defaults: { _controller: CacicCommonBundle:Software:editar} |
226 | requirements: | 406 | requirements: |
227 | idSoftware: \d+ | 407 | idSoftware: \d+ |
228 | 408 | ||
229 | cacic_software_excluir: | 409 | cacic_software_excluir: |
230 | - pattern: /software/excluir | 410 | + pattern: /manutencao/software/excluir |
231 | defaults: { _controller: CacicCommonBundle:Software:excluir} | 411 | defaults: { _controller: CacicCommonBundle:Software:excluir} |
232 | 412 | ||
233 | cacic_software_naoclassificados: | 413 | cacic_software_naoclassificados: |
234 | - pattern: /software/naoclassificados/{page} | 414 | + pattern: /manutencao/software/naoclassificados/{page} |
235 | defaults: { _controller: CacicCommonBundle:Software:naoClassificados, page:1} | 415 | defaults: { _controller: CacicCommonBundle:Software:naoClassificados, page:1} |
236 | requirements: | 416 | requirements: |
237 | page: \d+ | 417 | page: \d+ |
238 | 418 | ||
239 | cacic_software_naousados: | 419 | cacic_software_naousados: |
240 | - pattern: /software/naousados/{page} | 420 | + pattern: /manutencao/software/naousados/{page} |
241 | defaults: { _controller: CacicCommonBundle:Software:naoUsados, page:1} | 421 | defaults: { _controller: CacicCommonBundle:Software:naoUsados, page:1} |
242 | requirements: | 422 | requirements: |
243 | page: \d+ | 423 | page: \d+ |
244 | 424 | ||
245 | -cacic_configuracao_padrao: | ||
246 | - pattern: /configuracao/padrao | ||
247 | - defaults: { _controller: CacicCommonBundle:Configuracao:padrao} | ||
248 | - | ||
249 | -cacic_configuracao_gerente: | ||
250 | - pattern: /configuracao/gerente | ||
251 | - defaults: { _controller: CacicCommonBundle:Configuracao:gerente} | ||
252 | - | ||
253 | -cacic_configuracao_agente: | ||
254 | - pattern: /configuracao/agente | ||
255 | - defaults: { _controller: CacicCommonBundle:Configuracao:agente} | ||
256 | - | ||
257 | -cacic_configuracao_salvar: | ||
258 | - pattern: /configuracao/salvar | ||
259 | - defaults: { _controller: CacicCommonBundle:Configuracao:salvarconfiguracao} | ||
260 | - | ||
261 | -cacic_modulo_index: | ||
262 | - pattern: /modulo | ||
263 | - defaults: { _controller: CacicCommonBundle:Modulo:index} | ||
264 | - | ||
265 | -cacic_modulo_editar: | ||
266 | - pattern: /modulo/editar/{idAcao} | ||
267 | - defaults: { _controller: CacicCommonBundle:Modulo:editar} | ||
268 | - | ||
269 | cacic_usbdevice_index: | 425 | cacic_usbdevice_index: |
270 | - pattern: /usbdevice/{page} | 426 | + pattern: /manutencao/usbdevice/{page} |
271 | defaults: {_controller: CacicCommonBundle:UsbDevice:index, page: 1 } | 427 | defaults: {_controller: CacicCommonBundle:UsbDevice:index, page: 1 } |
272 | requirements: | 428 | requirements: |
273 | page: \d+ | 429 | page: \d+ |
274 | 430 | ||
275 | cacic_usbdevice_cadastrar: | 431 | cacic_usbdevice_cadastrar: |
276 | - pattern: /usbdevice/cadastrar | 432 | + pattern: /manutencao/usbdevice/cadastrar |
277 | defaults: { _controller: CacicCommonBundle:UsbDevice:cadastrar} | 433 | defaults: { _controller: CacicCommonBundle:UsbDevice:cadastrar} |
278 | 434 | ||
279 | cacic_usbdevice_editar: | 435 | cacic_usbdevice_editar: |
280 | - pattern: /usbdevice/editar/{idUsbDevice} | 436 | + pattern: /manutencao/usbdevice/editar/{idUsbDevice} |
281 | defaults: { _controller: CacicCommonBundle:UsbDevice:editar} | 437 | defaults: { _controller: CacicCommonBundle:UsbDevice:editar} |
282 | 438 | ||
283 | cacic_usbdevice_excluir: | 439 | cacic_usbdevice_excluir: |
284 | - pattern: /usbdevice/excluir | 440 | + pattern: /manutencao/usbdevice/excluir |
285 | defaults: { _controller: CacicCommonBundle:UsbDevice:excluir} | 441 | defaults: { _controller: CacicCommonBundle:UsbDevice:excluir} |
286 | 442 | ||
287 | -cacic_log_acesso: | ||
288 | - pattern: /log/acesso | ||
289 | - defaults: { _controller: CacicCommonBundle:Log:acesso} | ||
290 | - | ||
291 | -cacic_log_pesquisa: | ||
292 | - pattern: /log/pesquisa | ||
293 | - defaults: { _controller: CacicCommonBundle:Log:pesquisa} | ||
294 | - | ||
295 | -cacic_log_atividade: | ||
296 | - pattern: /log/atividade | ||
297 | - defaults: { _controller: CacicCommonBundle:Log:atividade} | ||
298 | - | ||
299 | -cacic_log_insucesso_instalacao: | ||
300 | - pattern: /log/insucessoinstalacao | ||
301 | - defaults: { _controller: CacicCommonBundle:Log:insucessoinstalacao} | ||
302 | - | ||
303 | -cacic_log_suporte_remoto: | ||
304 | - pattern: /log/suporteremoto | ||
305 | - defaults: { _controller: CacicCommonBundle:Log:suporteremoto} | ||
306 | - | ||
307 | -cacic_patrimonio_index: | ||
308 | - pattern: /patrimonio/index | ||
309 | - defaults: { _controller: CacicCommonBundle:PatrimonioConfigInterface:index} | ||
310 | - | ||
311 | -cacic_patrimonio_interface: | ||
312 | - pattern: /patrimonio/interface/{idEtiqueta} | ||
313 | - defaults: { _controller: CacicCommonBundle:PatrimonioConfigInterface:interface} | ||
314 | - | ||
315 | -cacic_patrimonio_opcoes: | ||
316 | - pattern: /patrimonio/opcoes | ||
317 | - defaults: { _controller: CacicCommonBundle:PatrimonioConfigInterface:opcoes} | ||
318 | - | ||
319 | -cacic_uorg_index: | ||
320 | - pattern: /uorg/index | ||
321 | - defaults: { _controller: CacicCommonBundle:Uorg:index} | ||
322 | - | ||
323 | -cacic_uorg_cadastrar: | ||
324 | - pattern: /uorg/cadastrar/{idUorgPai} | ||
325 | - defaults: { _controller: CacicCommonBundle:Uorg:cadastrar, idUorgPai: null} | ||
326 | - requirements: | ||
327 | - idUorgPai: \d+ | ||
328 | - | ||
329 | -cacic_uorg_editar: | ||
330 | - pattern: /uorg/editar/{idUorg} | ||
331 | - defaults: { _controller: CacicCommonBundle:Uorg:editar, idUorg: null} | ||
332 | - requirements: | ||
333 | - idUorg: \d+ | ||
334 | - | ||
335 | -cacic_uorg_excluir: | ||
336 | - pattern: /uorg/excluir/{idUorg} | ||
337 | - defaults: { _controller: CacicCommonBundle:Uorg:excluir, idUorg: null} | ||
338 | - requirements: | ||
339 | - idUorg: \d+ | ||
340 | - | ||
341 | -cacic_uorg_loadnodes: | ||
342 | - pattern: /uorg/loadnodes/{idUorgPai} | ||
343 | - defaults: { _controller: CacicCommonBundle:Uorg:loadnodes, idUorgPai: null} | ||
344 | - requirements: | ||
345 | - idUorgPai: \d+ | ||
346 | - | ||
347 | -cacic_uorg_visualizar: | ||
348 | - pattern: /uorg/visualizar/{idUorg} | ||
349 | - defaults: { _controller: CacicCommonBundle:Uorg:visualizar, idUorg: null} | ||
350 | - requirements: | ||
351 | - idUorg: \d+ | ||
352 | - | ||
353 | cacic_aquisicao_index: | 443 | cacic_aquisicao_index: |
354 | - pattern: /aquisicao/{page} | 444 | + pattern: /manutencao/aquisicao/{page} |
355 | defaults: {_controller: CacicCommonBundle:Aquisicao:index, page: 1 } | 445 | defaults: {_controller: CacicCommonBundle:Aquisicao:index, page: 1 } |
356 | requirements: | 446 | requirements: |
357 | page: \d+ | 447 | page: \d+ |
358 | 448 | ||
359 | cacic_aquisicao_cadastrar: | 449 | cacic_aquisicao_cadastrar: |
360 | - pattern: /aquisicao/cadastrar | 450 | + pattern: /manutencao/aquisicao/cadastrar |
361 | defaults: { _controller: CacicCommonBundle:Aquisicao:cadastrar} | 451 | defaults: { _controller: CacicCommonBundle:Aquisicao:cadastrar} |
362 | 452 | ||
363 | cacic_aquisicao_editar: | 453 | cacic_aquisicao_editar: |
364 | - pattern: /aquisicao/editar/{idAquisicao} | 454 | + pattern: /manutencao/aquisicao/editar/{idAquisicao} |
365 | defaults: { _controller: CacicCommonBundle:Aquisicao:editar} | 455 | defaults: { _controller: CacicCommonBundle:Aquisicao:editar} |
366 | requirements: | 456 | requirements: |
367 | idAquisicao: \d+ | 457 | idAquisicao: \d+ |
368 | 458 | ||
369 | cacic_aquisicao_excluir: | 459 | cacic_aquisicao_excluir: |
370 | - pattern: /aquisicao/excluir | 460 | + pattern: /manutencao/aquisicao/excluir |
371 | defaults: { _controller: CacicCommonBundle:Aquisicao:excluir} | 461 | defaults: { _controller: CacicCommonBundle:Aquisicao:excluir} |
372 | 462 | ||
373 | cacic_tipo_licenca_index: | 463 | cacic_tipo_licenca_index: |
374 | - pattern: /tipolicenca/{page} | 464 | + pattern: /manutencao/tipolicenca/{page} |
375 | defaults: {_controller: CacicCommonBundle:TipoLicenca:index, page: 1 } | 465 | defaults: {_controller: CacicCommonBundle:TipoLicenca:index, page: 1 } |
376 | requirements: | 466 | requirements: |
377 | page: \d+ | 467 | page: \d+ |
378 | 468 | ||
379 | cacic_tipo_licenca_cadastrar: | 469 | cacic_tipo_licenca_cadastrar: |
380 | - pattern: /tipolicenca/cadastrar | 470 | + pattern: /manutencao/tipolicenca/cadastrar |
381 | defaults: { _controller: CacicCommonBundle:TipoLicenca:cadastrar} | 471 | defaults: { _controller: CacicCommonBundle:TipoLicenca:cadastrar} |
382 | 472 | ||
383 | cacic_tipo_licenca_editar: | 473 | cacic_tipo_licenca_editar: |
384 | - pattern: /tipolicenca/editar/{idTipoLicenca} | 474 | + pattern: /manutencao/tipolicenca/editar/{idTipoLicenca} |
385 | defaults: { _controller: CacicCommonBundle:TipoLicenca:editar} | 475 | defaults: { _controller: CacicCommonBundle:TipoLicenca:editar} |
386 | requirements: | 476 | requirements: |
387 | idTipoLicenca: \d+ | 477 | idTipoLicenca: \d+ |
388 | 478 | ||
389 | cacic_tipo_licenca_excluir: | 479 | cacic_tipo_licenca_excluir: |
390 | - pattern: /tipolicenca/excluir | 480 | + pattern: /manutencao/tipolicenca/excluir |
391 | defaults: { _controller: CacicCommonBundle:TipoLicenca:excluir} | 481 | defaults: { _controller: CacicCommonBundle:TipoLicenca:excluir} |
392 | 482 | ||
393 | cacic_aquisicao_item_index: | 483 | cacic_aquisicao_item_index: |
394 | - pattern: /aquisicaoitem/{page} | 484 | + pattern: /manutencao/aquisicaoitem/{page} |
395 | defaults: {_controller: CacicCommonBundle:AquisicaoItem:index, page: 1 } | 485 | defaults: {_controller: CacicCommonBundle:AquisicaoItem:index, page: 1 } |
396 | requirements: | 486 | requirements: |
397 | page: \d+ | 487 | page: \d+ |
398 | 488 | ||
399 | cacic_aquisicao_item_cadastrar: | 489 | cacic_aquisicao_item_cadastrar: |
400 | - pattern: /aquisicaoitem/cadastrar | 490 | + pattern: /manutencao/aquisicaoitem/cadastrar |
401 | defaults: { _controller: CacicCommonBundle:AquisicaoItem:cadastrar} | 491 | defaults: { _controller: CacicCommonBundle:AquisicaoItem:cadastrar} |
402 | 492 | ||
403 | cacic_aquisicao_item_editar: | 493 | cacic_aquisicao_item_editar: |
404 | - pattern: /aquisicaoitem/editar/{idAquisicao}/{idSoftware}/{idTipoLicenca} | 494 | + pattern: /manutencao/aquisicaoitem/editar/{idAquisicao}/{idSoftware}/{idTipoLicenca} |
405 | defaults: { _controller: CacicCommonBundle:AquisicaoItem:editar} | 495 | defaults: { _controller: CacicCommonBundle:AquisicaoItem:editar} |
406 | requirements: | 496 | requirements: |
407 | idSoftware: \d+ | 497 | idSoftware: \d+ |
@@ -409,30 +499,62 @@ cacic_aquisicao_item_editar: | @@ -409,30 +499,62 @@ cacic_aquisicao_item_editar: | ||
409 | idAquisicao: \d+ | 499 | idAquisicao: \d+ |
410 | 500 | ||
411 | cacic_aquisicao_item_excluir: | 501 | cacic_aquisicao_item_excluir: |
412 | - pattern: /aquisicaoitem/excluir | 502 | + pattern: /manutencao/aquisicaoitem/excluir |
413 | defaults: { _controller: CacicCommonBundle:AquisicaoItem:excluir} | 503 | defaults: { _controller: CacicCommonBundle:AquisicaoItem:excluir} |
414 | 504 | ||
415 | cacic_software_estacao_index: | 505 | cacic_software_estacao_index: |
416 | - pattern: /softwareestacao/{page} | 506 | + pattern: /manutencao/softwareestacao/{page} |
417 | defaults: {_controller: CacicCommonBundle:SoftwareEstacao:index, page: 1 } | 507 | defaults: {_controller: CacicCommonBundle:SoftwareEstacao:index, page: 1 } |
418 | requirements: | 508 | requirements: |
419 | page: \d+ | 509 | page: \d+ |
420 | 510 | ||
421 | cacic_software_estacao_cadastrar: | 511 | cacic_software_estacao_cadastrar: |
422 | - pattern: /softwareestacao/cadastrar | 512 | + pattern: /manutencao/softwareestacao/cadastrar |
423 | defaults: { _controller: CacicCommonBundle:SoftwareEstacao:cadastrar} | 513 | defaults: { _controller: CacicCommonBundle:SoftwareEstacao:cadastrar} |
424 | 514 | ||
425 | cacic_software_estacao_editar: | 515 | cacic_software_estacao_editar: |
426 | - pattern: /softwareestacao/editar/{idComputador}/{idSoftware} | 516 | + pattern: /manutencao/softwareestacao/editar/{idComputador}/{idSoftware} |
427 | defaults: { _controller: CacicCommonBundle:SoftwareEstacao:editar} | 517 | defaults: { _controller: CacicCommonBundle:SoftwareEstacao:editar} |
428 | requirements: | 518 | requirements: |
429 | idSoftware: \d+ | 519 | idSoftware: \d+ |
430 | idComputador: \d+ | 520 | idComputador: \d+ |
431 | 521 | ||
432 | cacic_software_estacao_excluir: | 522 | cacic_software_estacao_excluir: |
433 | - pattern: /softwareestacao/excluir | 523 | + pattern: /manutencao/softwareestacao/excluir |
434 | defaults: { _controller: CacicCommonBundle:SoftwareEstacao:excluir} | 524 | defaults: { _controller: CacicCommonBundle:SoftwareEstacao:excluir} |
435 | 525 | ||
526 | +############################################ | ||
527 | +# FIM: Usuário com perfil manutenção | ||
528 | +############################################ | ||
529 | + | ||
530 | + | ||
531 | +############################################ | ||
532 | +# INÍCIO: Páginas para usuários normais | ||
533 | +############################################ | ||
534 | + | ||
535 | + | ||
536 | +cacic_usuario_meus_dados: | ||
537 | + pattern: /usuario/meusdados | ||
538 | + defaults: { _controller: CacicCommonBundle:Usuario:meusdados} | ||
539 | + | ||
540 | +cacic_usuario_trocar_senha: | ||
541 | + pattern: /usuario/trocarsenha | ||
542 | + defaults: { _controller: CacicCommonBundle:Usuario:trocarsenha} | ||
543 | + | ||
544 | +cacic_usuario_trocar_propria_senha: | ||
545 | + pattern: /usuario/trocarpropriasenha | ||
546 | + defaults: { _controller: CacicCommonBundle:Usuario:trocarpropriasenha} | ||
547 | + | ||
548 | +cacic_usuario_editar: | ||
549 | + pattern: /usuario/editar/{idUsuario} | ||
550 | + defaults: { _controller: CacicCommonBundle:Usuario:editar, idUsuario: null} | ||
551 | + requirements: | ||
552 | + idUsuario: \d+ | ||
553 | + | ||
554 | +cacic_usuario_recuperar_senha: | ||
555 | + pattern: /usuario/recuperarsenha | ||
556 | + defaults: { _controller: CacicCommonBundle:Usuario:recuperarsenha} | ||
557 | + | ||
436 | cacic_computador_buscar: | 558 | cacic_computador_buscar: |
437 | pattern: /computadores/buscar | 559 | pattern: /computadores/buscar |
438 | defaults: { _controller: CacicCommonBundle:Computador:buscar} | 560 | defaults: { _controller: CacicCommonBundle:Computador:buscar} |
@@ -445,12 +567,6 @@ cacic_computador_consultar: | @@ -445,12 +567,6 @@ cacic_computador_consultar: | ||
445 | pattern: /computadores/consultar | 567 | pattern: /computadores/consultar |
446 | defaults: { _controller: CacicCommonBundle:Computador:consultar} | 568 | defaults: { _controller: CacicCommonBundle:Computador:consultar} |
447 | 569 | ||
448 | -cacic_computador_excluir: | ||
449 | - pattern: /computador/excluir/{idComputador} | ||
450 | - defaults: { _controller: CacicCommonBundle:Computador:excluir} | ||
451 | - requirements: | ||
452 | - idComputador: \d+ | ||
453 | - | ||
454 | cacic_computador_detalhar: | 570 | cacic_computador_detalhar: |
455 | pattern: /computador/detalhar/{idComputador} | 571 | pattern: /computador/detalhar/{idComputador} |
456 | defaults: { _controller: CacicCommonBundle:Computador:detalhar, idComputador: null } | 572 | defaults: { _controller: CacicCommonBundle:Computador:detalhar, idComputador: null } |
@@ -469,72 +585,10 @@ cacic_computador_loadcompnodes: | @@ -469,72 +585,10 @@ cacic_computador_loadcompnodes: | ||
469 | requirements: | 585 | requirements: |
470 | idSubrede: \d+ | 586 | idSubrede: \d+ |
471 | 587 | ||
472 | -cacic_computador_coletar: | ||
473 | - pattern: /computador/coletar | ||
474 | - defaults: { _controller: CacicCommonBundle:Computador:coletar } | ||
475 | - | ||
476 | -cacic_computador_versaoagente: | ||
477 | - pattern: /computador/versaoagente | ||
478 | - defaults: { _controller: CacicCommonBundle:Computador:versaoagente } | ||
479 | - | ||
480 | -cacic_rede_coletar: | ||
481 | - pattern: /rede/coletar | ||
482 | - defaults: { _controller: CacicCommonBundle:Rede:coletar } | ||
483 | - | ||
484 | -cacic_rede_coletar_submit: | ||
485 | - pattern: /rede/coletar/submit | ||
486 | - defaults: { _controller: CacicCommonBundle:Rede:submit } | ||
487 | - | ||
488 | -cacic_computador_update: | ||
489 | - pattern: /computador/update/{idComputador} | ||
490 | - defaults: { _controller: CacicCommonBundle:Computador:update, idComputador: null } | ||
491 | - | ||
492 | -cacic_migracao_cacic26: | ||
493 | - pattern: /migracao/cacic26 | ||
494 | - defaults: { _controller: CacicCommonBundle:Cacic26:importardados} | ||
495 | - | ||
496 | -cacic_migracao_importador: | ||
497 | - pattern: /migracao/importador | ||
498 | - defaults: { _controller: CacicCommonBundle:Cacic26:importarscript} | ||
499 | - | ||
500 | cacic_downloads: | 588 | cacic_downloads: |
501 | pattern: /downloads/ | 589 | pattern: /downloads/ |
502 | defaults: { _controller: CacicCommonBundle:Default:downloads } | 590 | defaults: { _controller: CacicCommonBundle:Default:downloads } |
503 | 591 | ||
504 | -cacic_uorg_type_index: | ||
505 | - pattern: /uorg/type/{page} | ||
506 | - defaults: { _controller: CacicCommonBundle:UorgType:index, page: 1 } | ||
507 | - requirements: | ||
508 | - page: \d+ | ||
509 | - | ||
510 | -cacic_uorg_type_cadastrar: | ||
511 | - pattern: /uorg/type/cadastrar/{idUorgType} | ||
512 | - defaults: { _controller: CacicCommonBundle:UorgType:cadastrar, idUorgType: null} | ||
513 | - | ||
514 | -cacic_uorg_type_excluir: | ||
515 | - pattern: /uorg/type/excluir | ||
516 | - defaults: { _controller: CacicCommonBundle:UorgType:excluir} | ||
517 | - | ||
518 | -cacic_grupo_usuario_index: | ||
519 | - pattern: /grupousuario/{page} | ||
520 | - defaults: { _controller: CacicCommonBundle:GrupoUsuario:index, page: 1 } | ||
521 | - requirements: | ||
522 | - page: \d+ | ||
523 | - | ||
524 | -cacic_grupo_usuario_cadastrar: | ||
525 | - pattern: /grupousuario/cadastrar | ||
526 | - defaults: { _controller: CacicCommonBundle:GrupoUsuario:cadastrar} | ||
527 | - | ||
528 | -cacic_grupo_usuario_editar: | ||
529 | - pattern: /grupousuario/editar/{idGrupoUsuario} | ||
530 | - defaults: { _controller: CacicCommonBundle:GrupoUsuario:editar} | ||
531 | - requirements: | ||
532 | - idGrupoUsuario: \d+ | ||
533 | - | ||
534 | -cacic_grupo_usuario_excluir: | ||
535 | - pattern: /grupousuario/excluir | ||
536 | - defaults: { _controller: CacicCommonBundle:GrupoUsuario:excluir} | ||
537 | - | ||
538 | -cacic_ateste: | ||
539 | - pattern: /ateste/ | ||
540 | - defaults: { _controller: CacicCommonBundle:Ateste:index } | ||
541 | \ No newline at end of file | 592 | \ No newline at end of file |
593 | +############################################ | ||
594 | +# FIM: Páginas para usuários normais | ||
595 | +############################################ | ||
542 | \ No newline at end of file | 596 | \ No newline at end of file |
src/Cacic/CommonBundle/Resources/views/Agente/deploy.html.twig
0 → 100644
@@ -0,0 +1,127 @@ | @@ -0,0 +1,127 @@ | ||
1 | +{% extends 'CacicCommonBundle::base.html.twig' %} | ||
2 | + | ||
3 | +{% macro bytesToSize(bytes) %} | ||
4 | + {% spaceless %} | ||
5 | + {% set kilobyte = 1024 %} | ||
6 | + {% set megabyte = kilobyte * 1024 %} | ||
7 | + {% set gigabyte = megabyte * 1024 %} | ||
8 | + {% set terabyte = gigabyte * 1024 %} | ||
9 | + | ||
10 | + {% if bytes < kilobyte %} | ||
11 | + {{ bytes ~ ' B' }} | ||
12 | + {% elseif bytes < megabyte %} | ||
13 | + {{ (bytes / kilobyte)|number_format(2, '.') ~ ' KB' }} | ||
14 | + {% elseif bytes < gigabyte %} | ||
15 | + {{ (bytes / megabyte)|number_format(2, '.') ~ ' MB' }} | ||
16 | + {% elseif bytes < terabyte %} | ||
17 | + {{ (bytes / gigabyte)|number_format(2, '.') ~ ' GB' }} | ||
18 | + {% else %} | ||
19 | + {{ (bytes / terabyte)|number_format(2, '.') ~ ' TB' }} | ||
20 | + {% endif %} | ||
21 | + {% endspaceless %} | ||
22 | +{% endmacro %} | ||
23 | + | ||
24 | +{% block breadcrumb %} | ||
25 | + <li class="active">{{ 'Deploy de Software'|trans }}</li> | ||
26 | +{% endblock %} | ||
27 | + | ||
28 | +{% block body %} | ||
29 | + {% import _self as format %} | ||
30 | + | ||
31 | +<div class="row-fluid"> | ||
32 | + | ||
33 | + <div class="span8"> | ||
34 | + <div class="box grad_colour_black"> | ||
35 | + | ||
36 | + <h2 class="box_head round_top"><i class="icon-file"></i> {{'Upload de módulos para deploy' |trans }}</h2> | ||
37 | + | ||
38 | + <div class="block box_content round_bottom padding_10"> | ||
39 | + {{ form_start(form, {'id': 'formDeploy'|trans, 'action': path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')), 'method': 'POST'}) }} | ||
40 | + | ||
41 | + {{ form_errors(form) }} | ||
42 | + | ||
43 | + {{ form_row(form.outros) }} | ||
44 | + | ||
45 | + <input type="submit"> | ||
46 | + | ||
47 | + {{ form_end(form) }} | ||
48 | + | ||
49 | + </div> <!-- /block --> | ||
50 | + </div> <!-- /box --> | ||
51 | + </div> <!-- /span8 --> | ||
52 | + | ||
53 | + <div class="span4"> | ||
54 | + <div class="box grad_colour_black"> | ||
55 | + | ||
56 | + <h2 class="box_head round_top"><i class="icon-info-sign"></i> {{ "Informações Adicionais"|trans }}</h2> | ||
57 | + | ||
58 | + <div class="block box_content round_bottom padding_10"> | ||
59 | + <p> | ||
60 | + {{ "Realize o upload do arquivo para deploy nas estações de trabalho."|trans }} | ||
61 | + </p> | ||
62 | + <p> | ||
63 | + {{ "Os módulos ainda precisam ser habilitados nas subredes"|trans }} | ||
64 | + </p> | ||
65 | + </div> <!-- /block --> | ||
66 | + </div> <!-- /box --> | ||
67 | + </div> <!-- span4 --> | ||
68 | + | ||
69 | +</div> <!-- /row --> | ||
70 | + | ||
71 | +<div class="row-fluid"> | ||
72 | + <div class="span12"> | ||
73 | + <div class="box grad_colour_black"> | ||
74 | + <h2 class="box_head round_top"><i class="icon-list"></i> {{'Lista de Softwares disponíveis' |trans }}</h2> | ||
75 | + | ||
76 | + <div class="block box_content round_bottom padding_10"> | ||
77 | + <h4><center>{{ "Softwares para deploy"|trans }}</h4> | ||
78 | + <table class="table table-striped table-bordered"> | ||
79 | + <thead> | ||
80 | + <tr> | ||
81 | + <th width="30%" style="text-align: center">{{ 'Arquivo'|trans }}</th> | ||
82 | + <th width="25%" style="text-align: center">{{ 'Hash'|trans }}</th> | ||
83 | + <th width="20%" style="text-align: center">{{ 'Tamanho'|trans }}</th> | ||
84 | + <th style="text-align: center">{{ "Ações"|trans }}</th> | ||
85 | + </tr> | ||
86 | + </thead> | ||
87 | + <tbody> | ||
88 | + {% for modulo in saida.outros %} | ||
89 | + {% if modulo is empty %} | ||
90 | + <tr> | ||
91 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
92 | + </tr> | ||
93 | + {% else %} | ||
94 | + <tr id="{{ modulo['filename'] }}" class="{{ cycle(['row0', 'row1'], loop.index) }}"> | ||
95 | + <td style="text-align: center" >{{ modulo['name'] }}</td> | ||
96 | + <td style="text-align: center" >{{ modulo['hash'] }}</td> | ||
97 | + <td style="text-align: center" >{{ format.bytesToSize(modulo['size']) }}</td> | ||
98 | + <td class="td-actions"> | ||
99 | + <a href="{{ path('cacic_agente_excluir') }}" class="btn btn-small btn-danger bt-excluir" title="{{ "Excluir Item"|trans }}"> | ||
100 | + <i class="btn-icon-only icon-trash icon-large"></i> | ||
101 | + </a> | ||
102 | + <a href="{{ modulo['download_url'] }}" class="btn btn-small" title="{{ "Baixar"|trans }}" target="_blank"> | ||
103 | + <i class="btn-icon-only icon-download-alt icon-large"></i> | ||
104 | + </a> | ||
105 | + </td> | ||
106 | + </tr> | ||
107 | + {% endif %} | ||
108 | + {% else %} | ||
109 | + <tr> | ||
110 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
111 | + </tr> | ||
112 | + {% endfor %} | ||
113 | + </tbody> | ||
114 | + </table> | ||
115 | + | ||
116 | + </div> <!-- /block --> | ||
117 | + </div> <!-- /box --> | ||
118 | + </div> <!-- /span --> | ||
119 | +</div> <!-- /row --> | ||
120 | + | ||
121 | +{% endblock %} | ||
122 | + | ||
123 | +{% block javascripts %} | ||
124 | + | ||
125 | + {{ parent() }} | ||
126 | + | ||
127 | +{% endblock %} | ||
0 | \ No newline at end of file | 128 | \ No newline at end of file |
src/Cacic/CommonBundle/Resources/views/Agente/index.html.twig
0 → 100644
@@ -0,0 +1,212 @@ | @@ -0,0 +1,212 @@ | ||
1 | +{% extends 'CacicCommonBundle::base.html.twig' %} | ||
2 | + | ||
3 | +{% macro bytesToSize(bytes) %} | ||
4 | + {% spaceless %} | ||
5 | + {% set kilobyte = 1024 %} | ||
6 | + {% set megabyte = kilobyte * 1024 %} | ||
7 | + {% set gigabyte = megabyte * 1024 %} | ||
8 | + {% set terabyte = gigabyte * 1024 %} | ||
9 | + | ||
10 | + {% if bytes < kilobyte %} | ||
11 | + {{ bytes ~ ' B' }} | ||
12 | + {% elseif bytes < megabyte %} | ||
13 | + {{ (bytes / kilobyte)|number_format(2, '.') ~ ' KB' }} | ||
14 | + {% elseif bytes < gigabyte %} | ||
15 | + {{ (bytes / megabyte)|number_format(2, '.') ~ ' MB' }} | ||
16 | + {% elseif bytes < terabyte %} | ||
17 | + {{ (bytes / gigabyte)|number_format(2, '.') ~ ' GB' }} | ||
18 | + {% else %} | ||
19 | + {{ (bytes / terabyte)|number_format(2, '.') ~ ' TB' }} | ||
20 | + {% endif %} | ||
21 | + {% endspaceless %} | ||
22 | +{% endmacro %} | ||
23 | + | ||
24 | +{% block breadcrumb %} | ||
25 | + <li class="active">{{ 'Upload de Agentes'|trans }}</li> | ||
26 | +{% endblock %} | ||
27 | + | ||
28 | +{% block body %} | ||
29 | + {% import _self as format %} | ||
30 | + | ||
31 | +<div class="row-fluid"> | ||
32 | + | ||
33 | + <div class="span8"> | ||
34 | + <div class="box grad_colour_black"> | ||
35 | + | ||
36 | + <h2 class="box_head round_top"><i class="icon-file"></i> {{'Upload de agentes' |trans }}</h2> | ||
37 | + | ||
38 | + <div class="block box_content round_bottom padding_10"> | ||
39 | + {{ form_start(form, {'id': 'formAgentes'|trans, 'action': path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')), 'method': 'POST'}) }} | ||
40 | + | ||
41 | + {{ form_errors(form) }} | ||
42 | + | ||
43 | + {{ form_row(form.windows_version) }} | ||
44 | + | ||
45 | + {{ form_row(form.windows) }} | ||
46 | + | ||
47 | + {{ form_row(form.linux_version) }} | ||
48 | + | ||
49 | + {{ form_row(form.linux) }} | ||
50 | + | ||
51 | + <input type="submit"> | ||
52 | + | ||
53 | + {{ form_end(form) }} | ||
54 | + | ||
55 | + </div> <!-- /block --> | ||
56 | + </div> <!-- /box --> | ||
57 | + </div> <!-- /span8 --> | ||
58 | + | ||
59 | + <div class="span4"> | ||
60 | + <div class="box grad_colour_black"> | ||
61 | + | ||
62 | + <h2 class="box_head round_top"><i class="icon-info-sign"></i> {{ "Informações Adicionais"|trans }}</h2> | ||
63 | + | ||
64 | + <div class="block box_content round_bottom padding_10"> | ||
65 | + <p> | ||
66 | + {{ "Realize o upload do pacote de arquivos contendo a nova versão do agente que será disponibilizada no servidor"|trans }}. | ||
67 | + </p> | ||
68 | + <p> | ||
69 | + {{ "Ao realizar upload do pacote de agentes, informe o número da versão. O último enviado sempre será considerado o mais atual"|trans }}. | ||
70 | + </p> | ||
71 | + <p> | ||
72 | + {{ "IMPORTANTE: só serão aceitos arquivos nos formatos .zip e .tar.gz"|trans }}. | ||
73 | + </p> | ||
74 | + </div> <!-- /block --> | ||
75 | + </div> <!-- /box --> | ||
76 | + </div> <!-- span4 --> | ||
77 | + | ||
78 | +</div> <!-- /row --> | ||
79 | + | ||
80 | +<div class="row-fluid"> | ||
81 | + <div class="span12"> | ||
82 | + <div class="box grad_colour_black"> | ||
83 | + <h2 class="box_head round_top"><i class="icon-list"></i> {{'Resultado da pesquisa' |trans }}</h2> | ||
84 | + | ||
85 | + <div class="block box_content round_bottom padding_10"> | ||
86 | + <h4><center>{{ "Agentes para GNU/LINUX"|trans }}</h4> | ||
87 | + <table class="table table-striped table-bordered"> | ||
88 | + <thead> | ||
89 | + <tr> | ||
90 | + <th width="15%" style="text-align: center">{{ 'Versão'|trans }}</th> | ||
91 | + <th width="30%" style="text-align: center">{{ 'Arquivo'|trans }}</th> | ||
92 | + <th width="25%" style="text-align: center">{{ 'Hash'|trans }}</th> | ||
93 | + <th width="20%" style="text-align: center">{{ 'Tamanho'|trans }}</th> | ||
94 | + <th style="text-align: center">{{ "Ações"|trans }}</th> | ||
95 | + </tr> | ||
96 | + </thead> | ||
97 | + <tbody> | ||
98 | + | ||
99 | + {% for version, value in saida.linux.versions %} | ||
100 | + | ||
101 | + {% if version == saida.linux.live_version %} | ||
102 | + <tr> | ||
103 | + <th rowspan="{{ value|length + 1 }}" style="vertical-align: middle; text-align: center;"> | ||
104 | + {{ "Versão"|trans }} {{ version }} <br> {{ "(Em Produção)"|trans }} | ||
105 | + </th> | ||
106 | + </tr> | ||
107 | + {% else %} | ||
108 | + <tr> | ||
109 | + <th rowspan="{{ value|length + 1 }}" style="vertical-align: middle; text-align: center;"> | ||
110 | + {{ "Versão"|trans }} {{ version }} | ||
111 | + </th> | ||
112 | + </tr> | ||
113 | + {% endif %} | ||
114 | + | ||
115 | + {% for modulo in value %} | ||
116 | + | ||
117 | + <tr id="{{ modulo['filename'] }}" class="{{ cycle(['row0', 'row1'], loop.index) }}"> | ||
118 | + <td style="text-align: center" >{{ modulo['name'] }}</td> | ||
119 | + <td style="text-align: center" >{{ modulo['hash'] }}</td> | ||
120 | + <td style="text-align: center" >{{ format.bytesToSize(modulo['size']) }}</td> | ||
121 | + <td class="td-actions"> | ||
122 | + <a href="{{ path('cacic_agente_excluir') }}" class="btn btn-small btn-danger bt-excluir" title="{{ "Excluir Item"|trans }}"> | ||
123 | + <i class="btn-icon-only icon-trash icon-large"></i> | ||
124 | + </a> | ||
125 | + <a href="{{ modulo['download_url'] }}" class="btn btn-small" title="{{ "Baixar"|trans }}" target="_blank"> | ||
126 | + <i class="btn-icon-only icon-download-alt icon-large"></i> | ||
127 | + </a> | ||
128 | + </td> | ||
129 | + </tr> | ||
130 | + {% else %} | ||
131 | + <tr> | ||
132 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
133 | + </tr> | ||
134 | + {% endfor %} | ||
135 | + {% else %} | ||
136 | + <tr> | ||
137 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
138 | + </tr> | ||
139 | + {% endfor %} | ||
140 | + </tbody> | ||
141 | + </table> | ||
142 | + | ||
143 | + <h4><center>{{ "Agentes para Windows"|trans }}</h4> | ||
144 | + <table class="table table-striped table-bordered"> | ||
145 | + <thead> | ||
146 | + <tr> | ||
147 | + <th width="15%" style="text-align: center">{{ 'Versão'|trans }}</th> | ||
148 | + <th width="30%" style="text-align: center">{{ 'Arquivo'|trans }}</th> | ||
149 | + <th width="25%" style="text-align: center">{{ 'Hash'|trans }}</th> | ||
150 | + <th width="20%" style="text-align: center">{{ 'Tamanho'|trans }}</th> | ||
151 | + <th style="text-align: center">{{ "Ações"|trans }}</th> | ||
152 | + </tr> | ||
153 | + </thead> | ||
154 | + <tbody> | ||
155 | + | ||
156 | + {% for version, value in saida.windows.versions %} | ||
157 | + | ||
158 | + {% if version == saida.windows.live_version %} | ||
159 | + <tr> | ||
160 | + <th rowspan="{{ value|length + 1 }}" style="vertical-align: middle; text-align: center;"> | ||
161 | + {{ "Versão"|trans }} {{ version }} <br> {{ "(Em Produção)"|trans }} | ||
162 | + </th> | ||
163 | + </tr> | ||
164 | + {% else %} | ||
165 | + <tr> | ||
166 | + <th rowspan="{{ value|length + 1 }}" style="vertical-align: middle; text-align: center;"> | ||
167 | + {{ "Versão"|trans }} {{ version }} | ||
168 | + </th> | ||
169 | + </tr> | ||
170 | + {% endif %} | ||
171 | + | ||
172 | + | ||
173 | + {% for modulo in value %} | ||
174 | + | ||
175 | + <tr id="{{ modulo['filename'] }}" class="{{ cycle(['row0', 'row1'], loop.index) }}"> | ||
176 | + <td style="text-align: center" >{{ modulo['name'] }}</td> | ||
177 | + <td style="text-align: center" >{{ modulo['hash'] }}</td> | ||
178 | + <td style="text-align: center" >{{ format.bytesToSize(modulo['size']) }}</td> | ||
179 | + <td class="td-actions"> | ||
180 | + <a href="{{ path('cacic_agente_excluir') }}" class="btn btn-small btn-danger bt-excluir" title="{{ "Excluir Item"|trans }}"> | ||
181 | + <i class="btn-icon-only icon-trash icon-large"></i> | ||
182 | + </a> | ||
183 | + <a href="{{ modulo['download_url'] }}" class="btn btn-small" title="{{ "Baixar"|trans }}" target="_blank"> | ||
184 | + <i class="btn-icon-only icon-download-alt icon-large"></i> | ||
185 | + </a> | ||
186 | + </td> | ||
187 | + </tr> | ||
188 | + {% else %} | ||
189 | + <tr> | ||
190 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
191 | + </tr> | ||
192 | + {% endfor %} | ||
193 | + {% else %} | ||
194 | + <tr> | ||
195 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
196 | + </tr> | ||
197 | + {% endfor %} | ||
198 | + </tbody> | ||
199 | + </table> | ||
200 | + | ||
201 | + </div> <!-- /block --> | ||
202 | + </div> <!-- /box --> | ||
203 | + </div> <!-- /span --> | ||
204 | +</div> <!-- /row --> | ||
205 | + | ||
206 | +{% endblock %} | ||
207 | + | ||
208 | +{% block javascripts %} | ||
209 | + | ||
210 | + {{ parent() }} | ||
211 | + | ||
212 | +{% endblock %} | ||
0 | \ No newline at end of file | 213 | \ No newline at end of file |
src/Cacic/CommonBundle/Resources/views/Agente/listar.html.twig
0 → 100644
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +<div class="row-fluid"> | ||
2 | + <div class="span12"> | ||
3 | + <div class="box grad_colour_black"> | ||
4 | + <h2 class="box_head round_top"><i class="icon-list"></i> {{'Resultado da pesquisa' |trans }}</h2> | ||
5 | + <div class="block box_content round_bottom padding_10"> | ||
6 | + | ||
7 | + <iframe src="{{ path('cacic_common_homepage') }}elfinder/form" height="300px" width="100%"></iframe> | ||
8 | + | ||
9 | + | ||
10 | + </div> <!-- /block --> | ||
11 | + </div> <!-- /box --> | ||
12 | + </div> <!-- /span --> | ||
13 | +</div> <!-- /row --> | ||
0 | \ No newline at end of file | 14 | \ No newline at end of file |
src/Cacic/CommonBundle/Resources/views/Default/index.html.twig
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | <div class="row-fluid"> | 5 | <div class="row-fluid"> |
6 | 6 | ||
7 | - {% if nivel['teGrupoUsuarios'] == 'Administração' %} | 7 | + {% if nivel['nmGrupoUsuarios'] == 'Admin' %} |
8 | <div class="span6 column ui-sortable" id="col0"> | 8 | <div class="span6 column ui-sortable" id="col0"> |
9 | <div class="box grad_colour_black" id="box0"> | 9 | <div class="box grad_colour_black" id="box0"> |
10 | <h2 class="box_head round_top"><i class="icon-bar-chart"></i> {{ 'Estatísticas do sistema'|trans }}</h2> | 10 | <h2 class="box_head round_top"><i class="icon-bar-chart"></i> {{ 'Estatísticas do sistema'|trans }}</h2> |
src/Cacic/CommonBundle/Resources/views/Rede/manutencaoNeo.html.twig
0 → 100644
@@ -0,0 +1,195 @@ | @@ -0,0 +1,195 @@ | ||
1 | +{% extends 'CacicCommonBundle::base.html.twig' %} | ||
2 | + | ||
3 | +{% block breadcrumb %} | ||
4 | +<li class="active">{{ 'Atualizacoes de subredes'|trans }}</li> | ||
5 | +{% endblock %} | ||
6 | + | ||
7 | +{% block body %} | ||
8 | + | ||
9 | +<div class="row-fluid"> | ||
10 | + <div class="span12"> | ||
11 | + | ||
12 | + <div class="box grad_colour_black"> | ||
13 | + | ||
14 | + <h2 class="box_head round_top"><i class="icon-hdd"></i> {{ 'Atualizações de subredes'|trans }}</h2> | ||
15 | + | ||
16 | + <div class="block box_content round_bottom padding_10"> | ||
17 | + | ||
18 | + <h3>{{ 'Conteúdo do repositório'|trans }}</h3> | ||
19 | + <p>{{ 'As informações referem-se aos objetos constantes do repositório, os quais poderão ser assinalados para verificação de existência e/ou versões nas SubRedes cadastradas'|trans }}.</p> | ||
20 | + <br /> | ||
21 | + | ||
22 | + <form id={{ 'formSoftwaresNaoUsados'|trans }} class="form-horizontal" action="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" method="post"> | ||
23 | + <h4 align="center">{{ "Agentes para MS-Windows"|trans }}</h4> | ||
24 | + <table class="table table-striped table-bordered"> | ||
25 | + <thead> | ||
26 | + <tr> | ||
27 | + <th width="40%" style="text-align: center">{{ 'Arquivo'|trans }}</th> | ||
28 | + <th width="20%" style="text-align: center">{{ 'Versão'|trans }}</th> | ||
29 | + <th width="40%" style="text-align: center">{{ 'Hash'|trans }}</th> | ||
30 | + <th style="text-align: center"> | ||
31 | + <label style="margin: auto; width:12px; height:10px;"> | ||
32 | + <input type="checkbox" class="toggleCheck" name="toggleCheck[]" value="windows" checked> | ||
33 | + </label> | ||
34 | + </th> | ||
35 | + </tr> | ||
36 | + </thead> | ||
37 | + <tbody> | ||
38 | + | ||
39 | + {% for key, modulo in windows %} | ||
40 | + | ||
41 | + <tr id="item_{{ key }}"> | ||
42 | + <td style="text-align: center" id="item_desc_{{ key }}">{{ key }}</td> | ||
43 | + <td style="text-align: center" >{{ modulo['versao'] }}</td> | ||
44 | + <td style="text-align: center" >{{ modulo['hash'] }}</td> | ||
45 | + <td> | ||
46 | + <label style="margin: auto; width:12px; height:10px;"> | ||
47 | + <input type="checkbox" id="item_id_{{ key }}" name="windows[]" value="{{ key }}" checked> | ||
48 | + </label> | ||
49 | + </td> | ||
50 | + </tr> | ||
51 | + {% else %} | ||
52 | + <tr> | ||
53 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
54 | + </tr> | ||
55 | + {% endfor %} | ||
56 | + </tbody> | ||
57 | + </table> | ||
58 | + <br /> | ||
59 | + <table class="table table-striped table-bordered"> | ||
60 | + <h4><center>{{ "Agentes para GNU/LINUX"|trans }}</h4> | ||
61 | + <thead> | ||
62 | + <tr> | ||
63 | + <th width="40%"style="text-align: center">{{ 'Arquivo'|trans }}</th> | ||
64 | + <th width="20%"style="text-align: center">{{ 'Versão'|trans }}</th> | ||
65 | + <th width="40%"style="text-align: center">{{ 'Hash'|trans }}</th> | ||
66 | + <th style="text-align: center"> | ||
67 | + <label style="margin: auto; width:12px; height:10px;"> | ||
68 | + <input type="checkbox" class="toggleCheck" name="toggleCheck[]" value="linux" checked> | ||
69 | + </label> | ||
70 | + </th> | ||
71 | + </tr> | ||
72 | + </thead> | ||
73 | + <tbody> | ||
74 | + {% for key, modulo in linux %} | ||
75 | + | ||
76 | + <tr id="item_{{ key }}"> | ||
77 | + <td style="text-align: center" id="item_desc_{{ key }}">{{ key }}</td> | ||
78 | + <td style="text-align: center" >{{ modulo['versao'] }}</td> | ||
79 | + <td style="text-align: center" >{{ modulo['hash'] }}</td> | ||
80 | + <td> | ||
81 | + <label style="margin: auto; width:12px; height:10px;"> | ||
82 | + <input type="checkbox" id="item_id_{{ key }}" name="linux" value="{{ key }}" checked> | ||
83 | + </label> | ||
84 | + </td> | ||
85 | + </tr> | ||
86 | + {% else %} | ||
87 | + <tr> | ||
88 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
89 | + </tr> | ||
90 | + {% endfor %} | ||
91 | + | ||
92 | + </tbody> | ||
93 | + </table> | ||
94 | + <br /> | ||
95 | + | ||
96 | + <hr> | ||
97 | + <h3>{{ 'Subredes cadastradas'|trans }}</h3> | ||
98 | + <p>{{ 'Subredes onde a operação de atualização deve ser executada '|trans }}.</p> | ||
99 | + <br /> | ||
100 | + | ||
101 | + <h4 align="center">{{ "Legenda"|trans }}</h4> | ||
102 | + <table class="table table-bordered"> | ||
103 | + <thead> | ||
104 | + <tr> | ||
105 | + <th width="30%" style="text-align: center;">{{ "Mensagem"|trans }}</th> | ||
106 | + <th width="70%" style="text-align: center;">{{ "Significado"|trans }}</th> | ||
107 | + </tr> | ||
108 | + </thead> | ||
109 | + <tbody> | ||
110 | + <tr> | ||
111 | + <td width="30%" style="text-align: center;"><span class='label label-important'>{{ "Módulos inexistentes"|trans }}</span></td> | ||
112 | + <td width="70%">{{ "Um ou mais dos módulos obrigatórios não está presente na subrede"|trans }}</td> | ||
113 | + </tr> | ||
114 | + <tr> | ||
115 | + <td width="30%" style="text-align: center;"><span class='label label-warning'>{{ "Módulos desatualizados"|trans }}</span></td> | ||
116 | + <td width="70%">{{ "Um ou mais dos módulos obrigatórios está desatualizado na subrede"|trans }}</td> | ||
117 | + </tr> | ||
118 | + <tr> | ||
119 | + <td width="30%" style="text-align: center;"><span class='label label-success'>{{ "Módulos atualizados"|trans }}</span></td> | ||
120 | + <td width="70%">{{ "Todos os módulos obrigatórios estão atualizados na subrede"|trans }}</td> | ||
121 | + </tr> | ||
122 | + </tbody> | ||
123 | + </table> | ||
124 | + | ||
125 | + <h4 align="center">{{ subredes|length }} {{ "SubRedes Cadastradas"|trans }}</h4> | ||
126 | + <table class="table table-striped table-bordered"> | ||
127 | + | ||
128 | + <thead> | ||
129 | + <tr> | ||
130 | + <th width="15%" style="text-align: center">{{ 'Endereço IP'|trans }}</th> | ||
131 | + <th width="25%" style="text-align: center">{{ 'Nome da Subrede'|trans }}</th> | ||
132 | + <th width="20%" style="text-align: center">{{ 'Servidor de atualizacoes'|trans }}</th> | ||
133 | + <th width="20%" style="text-align: center">{{ 'Localizacao'|trans }}</th> | ||
134 | + <th width="20%" style="text-align: center">{{ 'Status'|trans }}</th> | ||
135 | + <th style="text-align: center"> | ||
136 | + <label style="margin: auto; width:12px; height:10px;"> | ||
137 | + <input type="checkbox" class="toggleCheck" name="toggleCheck[]" value="subrede"> | ||
138 | + </label> | ||
139 | + </th> | ||
140 | + </tr> | ||
141 | + </thead> | ||
142 | + | ||
143 | + <tbody> | ||
144 | + {% for key, rede in subredes %} | ||
145 | + <tr id="item_{{ key }}"> | ||
146 | + <td style="text-align: center" id="item_desc_{{ key }}">{{ rede['teIpRede'] }}</td> | ||
147 | + <td style="text-align: center" >{{ rede['nmRede'] }}</td> | ||
148 | + <td style="text-align: center" >{{ rede['teServUpdates'] }}</td> | ||
149 | + <td style="text-align: center" >{{ rede['nmLocal'] }}</td> | ||
150 | + <td style="text-align: center;">{{ rede['codigo']|raw }}</td> | ||
151 | + <td> | ||
152 | + <label style="margin: auto; width:12px; height:10px;"> | ||
153 | + <input type="checkbox" id="item_id_{{ key }}" name="subrede[]" value="{{ key }}"> | ||
154 | + </label> | ||
155 | + </td> | ||
156 | + </tr> | ||
157 | + {% else %} | ||
158 | + <tr> | ||
159 | + <td style="text-align: center" colspan="6"><b>{{ 'NENHUM REGISTRO ENCONTRADO!'|trans }}</b></td> | ||
160 | + </tr> | ||
161 | + {% endfor %} | ||
162 | + | ||
163 | + </tbody> | ||
164 | + </table> | ||
165 | + <div class="control-group" align="right"> | ||
166 | + <div class="controls"> | ||
167 | + <button type="reset" class="btn"> | ||
168 | + <i class="icon-refresh"></i> | ||
169 | + {{ "Resetar Valores"|trans }} | ||
170 | + </button> | ||
171 | + <button type="submit" formnovalidate class="btn btn-primary"> | ||
172 | + <i class="icon-ok-sign"></i> | ||
173 | + {{ "Executar Atualizações"|trans }} | ||
174 | + </button> | ||
175 | + </div> | ||
176 | + </div> | ||
177 | + | ||
178 | + </form> | ||
179 | + | ||
180 | + </div> <!-- /block --> | ||
181 | + </div><!-- /box --> | ||
182 | + | ||
183 | + </div><!-- /span --> | ||
184 | +</div><!-- /row --> | ||
185 | +{% endblock %} | ||
186 | + | ||
187 | +{% block javascripts %} | ||
188 | + | ||
189 | +{{ parent() }} | ||
190 | + | ||
191 | +<script type="text/javascript"> | ||
192 | + System.Form.toggleCheck(); // Ativa o monitoramento de Clique no checkbox para marcar/desmarcar todos | ||
193 | +</script> | ||
194 | + | ||
195 | +{% endblock %} | ||
0 | \ No newline at end of file | 196 | \ No newline at end of file |
src/Cacic/CommonBundle/Tests/Controller/AgenteControllerTest.php
0 → 100644
@@ -0,0 +1,37 @@ | @@ -0,0 +1,37 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: eduardo | ||
5 | + * Date: 18/10/14 | ||
6 | + * Time: 21:14 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace Cacic\CommonBundle\Tests\Controller; | ||
10 | + | ||
11 | +use Cacic\CommonBundle\Tests\BaseTestCase; | ||
12 | +use Symfony\Component\HttpFoundation\Session; | ||
13 | + | ||
14 | + | ||
15 | +class AgenteControllerTest extends BaseTestCase { | ||
16 | + | ||
17 | + public function setUp() { | ||
18 | + // Load setup from BaseTestCase method | ||
19 | + parent::setUp(); | ||
20 | + | ||
21 | + // Cria o cliente utilizando autenticação HTTP para o usuário admin padrão | ||
22 | + $this->client = static::createClient( | ||
23 | + array(), | ||
24 | + array( | ||
25 | + 'PHP_AUTH_USER' => 'admin', | ||
26 | + 'PHP_AUTH_PW' => '123456', | ||
27 | + ) | ||
28 | + ); | ||
29 | + $this->container = $this->client->getContainer(); | ||
30 | + } | ||
31 | + | ||
32 | + public function tearDown() { | ||
33 | + // Executa método de limpeza de todos os casos de teste | ||
34 | + parent::tearDown(); | ||
35 | + } | ||
36 | + | ||
37 | +} | ||
0 | \ No newline at end of file | 38 | \ No newline at end of file |
src/Cacic/WSBundle/Controller/NeoController.php
@@ -267,11 +267,18 @@ class NeoController extends Controller { | @@ -267,11 +267,18 @@ class NeoController extends Controller { | ||
267 | 267 | ||
268 | // 2 - Adiciona módulos da subrede | 268 | // 2 - Adiciona módulos da subrede |
269 | $modulos = $em->getRepository('CacicCommonBundle:RedeVersaoModulo')->findBy(array('idRede' => $computador->getIdRede())); | 269 | $modulos = $em->getRepository('CacicCommonBundle:RedeVersaoModulo')->findBy(array('idRede' => $computador->getIdRede())); |
270 | - //$logger->debug("Módulos encontrados \n". print_r($modulos, true)); | 270 | + $logger->debug("Módulos encontrados \n". print_r($modulos, true)); |
271 | $mods = array(); | 271 | $mods = array(); |
272 | foreach($modulos as $elm) { | 272 | foreach($modulos as $elm) { |
273 | + $tipo = $elm->getTipo(); | ||
274 | + if (empty($tipo)) { | ||
275 | + $tipo = 'cacic'; | ||
276 | + } | ||
277 | + if (empty($mods[$tipo])) { | ||
278 | + $mods[$tipo] = array(); | ||
279 | + } | ||
273 | // Adiciona módulos e hashes | 280 | // Adiciona módulos e hashes |
274 | - array_push($mods, array( | 281 | + array_push($mods[$tipo], array( |
275 | 'nome' => $elm->getNmModulo(), | 282 | 'nome' => $elm->getNmModulo(), |
276 | 'hash' => $elm->getTeHash() | 283 | 'hash' => $elm->getTeHash() |
277 | )); | 284 | )); |
@@ -783,6 +790,7 @@ class NeoController extends Controller { | @@ -783,6 +790,7 @@ class NeoController extends Controller { | ||
783 | if(empty($computadorColeta)) { | 790 | if(empty($computadorColeta)) { |
784 | $logger->error("COLETA: Erro na identificação da coleta. O software está cadastrado mas não há ocorrência de coletas no computador"); | 791 | $logger->error("COLETA: Erro na identificação da coleta. O software está cadastrado mas não há ocorrência de coletas no computador"); |
785 | $computadorColeta = new ComputadorColeta(); | 792 | $computadorColeta = new ComputadorColeta(); |
793 | + $computador->addHardware( $computadorColeta ); | ||
786 | } | 794 | } |
787 | } else { | 795 | } else { |
788 | $logger->info("COLETA: Cadastrando software não encontrado $software"); | 796 | $logger->info("COLETA: Cadastrando software não encontrado $software"); |
@@ -842,7 +850,9 @@ class NeoController extends Controller { | @@ -842,7 +850,9 @@ class NeoController extends Controller { | ||
842 | $computadorColeta->setDtHrInclusao( new \DateTime() ); | 850 | $computadorColeta->setDtHrInclusao( new \DateTime() ); |
843 | 851 | ||
844 | // Mando salvar os dados do computador | 852 | // Mando salvar os dados do computador |
853 | + $computador->addHardware($computadorColeta); | ||
845 | $em->persist( $computadorColeta ); | 854 | $em->persist( $computadorColeta ); |
855 | + $em->persist( $computador ); | ||
846 | 856 | ||
847 | // Persistencia de Historico | 857 | // Persistencia de Historico |
848 | $computadorColetaHistorico = new ComputadorColetaHistorico(); | 858 | $computadorColetaHistorico = new ComputadorColetaHistorico(); |
src/Cacic/WSBundle/Tests/Controller/NeoControllerTest.php
@@ -296,7 +296,7 @@ class NeoControllerTest extends BaseTestCase | @@ -296,7 +296,7 @@ class NeoControllerTest extends BaseTestCase | ||
296 | $response = $this->client->getResponse(); | 296 | $response = $this->client->getResponse(); |
297 | $status = $response->getStatusCode(); | 297 | $status = $response->getStatusCode(); |
298 | $logger->debug("Response status: $status"); | 298 | $logger->debug("Response status: $status"); |
299 | - $logger->debug("JSON do getConfig: \n".$response->getContent()); | 299 | + //$logger->debug("JSON do getConfig: \n".$response->getContent()); |
300 | 300 | ||
301 | $this->assertEquals($status, 500); | 301 | $this->assertEquals($status, 500); |
302 | 302 |