Commit 55f4963b69bfbdb69f376173fac7dbca6b5e39ef

Authored by Eduardo Santos
2 parents ddeb9725 2c37cd9a
Exists in master

Import de correções na coleta para implementação na SDH

Showing 56 changed files with 4754 additions and 761 deletions   Show diff stats
app/AppKernel.php
... ... @@ -41,6 +41,10 @@ class AppKernel extends Kernel
41 41 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
42 42 }
43 43  
  44 + if (in_array($this->getEnvironment(), array('test'))) {
  45 + $bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle();
  46 + }
  47 +
44 48 return $bundles;
45 49 }
46 50  
... ...
app/Resources/views/base.html.twig
... ... @@ -27,6 +27,13 @@
27 27 {% endstylesheets %}
28 28  
29 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 38 {% endblock %}
32 39  
... ... @@ -164,13 +171,6 @@
164 171 </div><!--/.fluid-container-->
165 172  
166 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 176 {% javascripts output='assets/base.js' combine=true
... ...
app/bootstrap.php.cache
... ... @@ -95,7 +95,7 @@ public function getInt($key, $default = 0, $deep = false)
95 95 {
96 96 return (int) $this->get($key, $default, $deep);
97 97 }
98   -public function filter($key, $default = null, $deep = false, $filter=FILTER_DEFAULT, $options=array())
  98 +public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array())
99 99 {
100 100 $value = $this->get($key, $default, $deep);
101 101 if (!is_array($options) && $options) {
... ... @@ -120,12 +120,10 @@ namespace Symfony\Component\HttpFoundation
120 120 {
121 121 class HeaderBag implements \IteratorAggregate, \Countable
122 122 {
123   -protected $headers;
124   -protected $cacheControl;
  123 +protected $headers = array();
  124 +protected $cacheControl = array();
125 125 public function __construct(array $headers = array())
126 126 {
127   -$this->cacheControl = array();
128   -$this->headers = array();
129 127 foreach ($headers as $key => $values) {
130 128 $this->set($key, $values);
131 129 }
... ... @@ -369,12 +367,12 @@ $authorizationHeader = $this-&gt;parameters[&#39;HTTP_AUTHORIZATION&#39;];
369 367 $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION'];
370 368 }
371 369 if (null !== $authorizationHeader) {
372   -if (0 === stripos($authorizationHeader,'basic')) {
373   -$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));
  370 +if (0 === stripos($authorizationHeader,'basic ')) {
  371 +$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2);
374 372 if (count($exploded) == 2) {
375 373 list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
376 374 }
377   -} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest'))) {
  375 +} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest '))) {
378 376 $headers['PHP_AUTH_DIGEST'] = $authorizationHeader;
379 377 $this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader;
380 378 }
... ... @@ -418,6 +416,7 @@ public $headers;
418 416 protected $content;
419 417 protected $languages;
420 418 protected $charsets;
  419 +protected $encodings;
421 420 protected $acceptableContentTypes;
422 421 protected $pathInfo;
423 422 protected $requestUri;
... ... @@ -429,6 +428,7 @@ protected $session;
429 428 protected $locale;
430 429 protected $defaultLocale ='en';
431 430 protected static $formats;
  431 +protected static $requestFactory;
432 432 public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
433 433 {
434 434 $this->initialize($query, $request, $attributes, $cookies, $files, $server, $content);
... ... @@ -445,6 +445,7 @@ $this-&gt;headers = new HeaderBag($this-&gt;server-&gt;getHeaders());
445 445 $this->content = $content;
446 446 $this->languages = null;
447 447 $this->charsets = null;
  448 +$this->encodings = null;
448 449 $this->acceptableContentTypes = null;
449 450 $this->pathInfo = null;
450 451 $this->requestUri = null;
... ... @@ -455,7 +456,7 @@ $this-&gt;format = null;
455 456 }
456 457 public static function createFromGlobals()
457 458 {
458   -$request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
  459 +$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
459 460 if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded')
460 461 && in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH'))
461 462 ) {
... ... @@ -528,7 +529,11 @@ $queryString = http_build_query($query,&#39;&#39;,&#39;&amp;&#39;);
528 529 }
529 530 $server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :'');
530 531 $server['QUERY_STRING'] = $queryString;
531   -return new static($query, $request, array(), $cookies, $files, $server, $content);
  532 +return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content);
  533 +}
  534 +public static function setFactory($callable)
  535 +{
  536 +self::$requestFactory = $callable;
532 537 }
533 538 public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
534 539 {
... ... @@ -554,6 +559,7 @@ $dup-&gt;headers = new HeaderBag($dup-&gt;server-&gt;getHeaders());
554 559 }
555 560 $dup->languages = null;
556 561 $dup->charsets = null;
  562 +$dup->encodings = null;
557 563 $dup->acceptableContentTypes = null;
558 564 $dup->pathInfo = null;
559 565 $dup->requestUri = null;
... ... @@ -588,6 +594,7 @@ $this-&gt;getContent();
588 594 }
589 595 public function overrideGlobals()
590 596 {
  597 +$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), null,'&')));
591 598 $_GET = $this->query->all();
592 599 $_POST = $this->request->all();
593 600 $_SERVER = $this->server->all();
... ... @@ -753,7 +760,12 @@ return 443;
753 760 }
754 761 }
755 762 if ($host = $this->headers->get('HOST')) {
756   -if (false !== $pos = strrpos($host,':')) {
  763 +if ($host[0] ==='[') {
  764 +$pos = strpos($host,':', strrpos($host,']'));
  765 +} else {
  766 +$pos = strrpos($host,':');
  767 +}
  768 +if (false !== $pos) {
757 769 return intval(substr($host, $pos + 1));
758 770 }
759 771 return'https'=== $this->getScheme() ? 443 : 80;
... ... @@ -762,11 +774,11 @@ return $this-&gt;server-&gt;get(&#39;SERVER_PORT&#39;);
762 774 }
763 775 public function getUser()
764 776 {
765   -return $this->server->get('PHP_AUTH_USER');
  777 +return $this->headers->get('PHP_AUTH_USER');
766 778 }
767 779 public function getPassword()
768 780 {
769   -return $this->server->get('PHP_AUTH_PW');
  781 +return $this->headers->get('PHP_AUTH_PW');
770 782 }
771 783 public function getUserInfo()
772 784 {
... ... @@ -818,7 +830,8 @@ public function isSecure()
818 830 if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) {
819 831 return in_array(strtolower(current(explode(',', $proto))), array('https','on','ssl','1'));
820 832 }
821   -return'on'== strtolower($this->server->get('HTTPS')) || 1 == $this->server->get('HTTPS');
  833 +$https = $this->server->get('HTTPS');
  834 +return !empty($https) &&'off'!== strtolower($https);
822 835 }
823 836 public function getHost()
824 837 {
... ... @@ -831,8 +844,8 @@ $host = $this-&gt;server-&gt;get(&#39;SERVER_ADDR&#39;,&#39;&#39;);
831 844 }
832 845 }
833 846 $host = strtolower(preg_replace('/:\d+$/','', trim($host)));
834   -if ($host && !preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)) {
835   -throw new \UnexpectedValueException('Invalid Host "'.$host.'"');
  847 +if ($host &&''!== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/','', $host)) {
  848 +throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host));
836 849 }
837 850 if (count(self::$trustedHostPatterns) > 0) {
838 851 if (in_array($host, self::$trustedHosts)) {
... ... @@ -844,7 +857,7 @@ self::$trustedHosts[] = $host;
844 857 return $host;
845 858 }
846 859 }
847   -throw new \UnexpectedValueException('Untrusted Host "'.$host.'"');
  860 +throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host));
848 861 }
849 862 return $host;
850 863 }
... ... @@ -891,7 +904,6 @@ if (in_array($mimeType, (array) $mimeTypes)) {
891 904 return $format;
892 905 }
893 906 }
894   -return null;
895 907 }
896 908 public function setFormat($format, $mimeTypes)
897 909 {
... ... @@ -922,6 +934,10 @@ if (null === $this-&gt;locale) {
922 934 $this->setPhpDefaultLocale($locale);
923 935 }
924 936 }
  937 +public function getDefaultLocale()
  938 +{
  939 +return $this->defaultLocale;
  940 +}
925 941 public function setLocale($locale)
926 942 {
927 943 $this->setPhpDefaultLocale($this->locale = $locale);
... ... @@ -1017,6 +1033,13 @@ return $this-&gt;charsets;
1017 1033 }
1018 1034 return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all());
1019 1035 }
  1036 +public function getEncodings()
  1037 +{
  1038 +if (null !== $this->encodings) {
  1039 +return $this->encodings;
  1040 +}
  1041 +return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
  1042 +}
1020 1043 public function getAcceptableContentTypes()
1021 1044 {
1022 1045 if (null !== $this->acceptableContentTypes) {
... ... @@ -1161,12 +1184,65 @@ return $match[0];
1161 1184 }
1162 1185 return false;
1163 1186 }
  1187 +private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
  1188 +{
  1189 +if (self::$requestFactory) {
  1190 +$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content);
  1191 +if (!$request instanceof Request) {
  1192 +throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.');
  1193 +}
  1194 +return $request;
  1195 +}
  1196 +return new static($query, $request, $attributes, $cookies, $files, $server, $content);
  1197 +}
1164 1198 }
1165 1199 }
1166 1200 namespace Symfony\Component\HttpFoundation
1167 1201 {
1168 1202 class Response
1169 1203 {
  1204 +const HTTP_CONTINUE = 100;
  1205 +const HTTP_SWITCHING_PROTOCOLS = 101;
  1206 +const HTTP_PROCESSING = 102; const HTTP_OK = 200;
  1207 +const HTTP_CREATED = 201;
  1208 +const HTTP_ACCEPTED = 202;
  1209 +const HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
  1210 +const HTTP_NO_CONTENT = 204;
  1211 +const HTTP_RESET_CONTENT = 205;
  1212 +const HTTP_PARTIAL_CONTENT = 206;
  1213 +const HTTP_MULTI_STATUS = 207; const HTTP_ALREADY_REPORTED = 208; const HTTP_IM_USED = 226; const HTTP_MULTIPLE_CHOICES = 300;
  1214 +const HTTP_MOVED_PERMANENTLY = 301;
  1215 +const HTTP_FOUND = 302;
  1216 +const HTTP_SEE_OTHER = 303;
  1217 +const HTTP_NOT_MODIFIED = 304;
  1218 +const HTTP_USE_PROXY = 305;
  1219 +const HTTP_RESERVED = 306;
  1220 +const HTTP_TEMPORARY_REDIRECT = 307;
  1221 +const HTTP_PERMANENTLY_REDIRECT = 308; const HTTP_BAD_REQUEST = 400;
  1222 +const HTTP_UNAUTHORIZED = 401;
  1223 +const HTTP_PAYMENT_REQUIRED = 402;
  1224 +const HTTP_FORBIDDEN = 403;
  1225 +const HTTP_NOT_FOUND = 404;
  1226 +const HTTP_METHOD_NOT_ALLOWED = 405;
  1227 +const HTTP_NOT_ACCEPTABLE = 406;
  1228 +const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
  1229 +const HTTP_REQUEST_TIMEOUT = 408;
  1230 +const HTTP_CONFLICT = 409;
  1231 +const HTTP_GONE = 410;
  1232 +const HTTP_LENGTH_REQUIRED = 411;
  1233 +const HTTP_PRECONDITION_FAILED = 412;
  1234 +const HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
  1235 +const HTTP_REQUEST_URI_TOO_LONG = 414;
  1236 +const HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
  1237 +const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
  1238 +const HTTP_EXPECTATION_FAILED = 417;
  1239 +const HTTP_I_AM_A_TEAPOT = 418; const HTTP_UNPROCESSABLE_ENTITY = 422; const HTTP_LOCKED = 423; const HTTP_FAILED_DEPENDENCY = 424; const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; const HTTP_UPGRADE_REQUIRED = 426; const HTTP_PRECONDITION_REQUIRED = 428; const HTTP_TOO_MANY_REQUESTS = 429; const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const HTTP_INTERNAL_SERVER_ERROR = 500;
  1240 +const HTTP_NOT_IMPLEMENTED = 501;
  1241 +const HTTP_BAD_GATEWAY = 502;
  1242 +const HTTP_SERVICE_UNAVAILABLE = 503;
  1243 +const HTTP_GATEWAY_TIMEOUT = 504;
  1244 +const HTTP_VERSION_NOT_SUPPORTED = 505;
  1245 +const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; const HTTP_INSUFFICIENT_STORAGE = 507; const HTTP_LOOP_DETECTED = 508; const HTTP_NOT_EXTENDED = 510; const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511;
1170 1246 public $headers;
1171 1247 protected $content;
1172 1248 protected $version;
... ... @@ -1246,7 +1322,9 @@ public function prepare(Request $request)
1246 1322 $headers = $this->headers;
1247 1323 if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) {
1248 1324 $this->setContent(null);
1249   -}
  1325 +$headers->remove('Content-Type');
  1326 +$headers->remove('Content-Length');
  1327 +} else {
1250 1328 if (!$headers->has('Content-Type')) {
1251 1329 $format = $request->getRequestFormat();
1252 1330 if (null !== $format && $mimeType = $request->getMimeType($format)) {
... ... @@ -1255,9 +1333,9 @@ $headers-&gt;set(&#39;Content-Type&#39;, $mimeType);
1255 1333 }
1256 1334 $charset = $this->charset ?:'UTF-8';
1257 1335 if (!$headers->has('Content-Type')) {
1258   -$headers->set('Content-Type','text/html; charset='.$charset);
  1336 +$headers->set('Content-Type','text/html; charset='. $charset);
1259 1337 } elseif (0 === stripos($headers->get('Content-Type'),'text/') && false === stripos($headers->get('Content-Type'),'charset')) {
1260   -$headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset);
  1338 +$headers->set('Content-Type', $headers->get('Content-Type') .'; charset='. $charset);
1261 1339 }
1262 1340 if ($headers->has('Transfer-Encoding')) {
1263 1341 $headers->remove('Content-Length');
... ... @@ -1269,6 +1347,7 @@ if ($length) {
1269 1347 $headers->set('Content-Length', $length);
1270 1348 }
1271 1349 }
  1350 +}
1272 1351 if ('HTTP/1.0'!= $request->server->get('SERVER_PROTOCOL')) {
1273 1352 $this->setProtocolVersion('1.1');
1274 1353 }
... ... @@ -1284,10 +1363,10 @@ public function sendHeaders()
1284 1363 if (headers_sent()) {
1285 1364 return $this;
1286 1365 }
1287   -header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
  1366 +header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
1288 1367 foreach ($this->headers->allPreserveCase() as $name => $values) {
1289 1368 foreach ($values as $value) {
1290   -header($name.': '.$value, false);
  1369 +header($name.': '.$value, false, $this->statusCode);
1291 1370 }
1292 1371 }
1293 1372 foreach ($this->headers->getCookies() as $cookie) {
... ... @@ -1307,22 +1386,7 @@ $this-&gt;sendContent();
1307 1386 if (function_exists('fastcgi_finish_request')) {
1308 1387 fastcgi_finish_request();
1309 1388 } elseif ('cli'!== PHP_SAPI) {
1310   -$previous = null;
1311   -$obStatus = ob_get_status(1);
1312   -while (($level = ob_get_level()) > 0 && $level !== $previous) {
1313   -$previous = $level;
1314   -if ($obStatus[$level - 1]) {
1315   -if (version_compare(PHP_VERSION,'5.4','>=')) {
1316   -if (isset($obStatus[$level - 1]['flags']) && ($obStatus[$level - 1]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)) {
1317   -ob_end_flush();
1318   -}
1319   -} else {
1320   -if (isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) {
1321   -ob_end_flush();
1322   -}
1323   -}
1324   -}
1325   -}
  1389 +static::closeOutputBuffers(0, true);
1326 1390 flush();
1327 1391 }
1328 1392 return $this;
... ... @@ -1466,7 +1530,6 @@ return (int) $this-&gt;headers-&gt;getCacheControlDirective(&#39;max-age&#39;);
1466 1530 if (null !== $this->getExpires()) {
1467 1531 return $this->getExpires()->format('U') - $this->getDate()->format('U');
1468 1532 }
1469   -return null;
1470 1533 }
1471 1534 public function setMaxAge($value)
1472 1535 {
... ... @@ -1484,7 +1547,6 @@ public function getTtl()
1484 1547 if (null !== $maxAge = $this->getMaxAge()) {
1485 1548 return $maxAge - $this->getAge();
1486 1549 }
1487   -return null;
1488 1550 }
1489 1551 public function setTtl($seconds)
1490 1552 {
... ... @@ -1575,10 +1637,14 @@ return null !== $this-&gt;headers-&gt;get(&#39;Vary&#39;);
1575 1637 }
1576 1638 public function getVary()
1577 1639 {
1578   -if (!$vary = $this->headers->get('Vary')) {
  1640 +if (!$vary = $this->headers->get('Vary', null, false)) {
1579 1641 return array();
1580 1642 }
1581   -return is_array($vary) ? $vary : preg_split('/[\s,]+/', $vary);
  1643 +$ret = array();
  1644 +foreach ($vary as $item) {
  1645 +$ret = array_merge($ret, preg_split('/[\s,]+/', $item));
  1646 +}
  1647 +return $ret;
1582 1648 }
1583 1649 public function setVary($headers, $replace = true)
1584 1650 {
... ... @@ -1644,7 +1710,26 @@ return in_array($this-&gt;statusCode, array(201, 301, 302, 303, 307, 308)) &amp;&amp; (null
1644 1710 }
1645 1711 public function isEmpty()
1646 1712 {
1647   -return in_array($this->statusCode, array(201, 204, 304));
  1713 +return in_array($this->statusCode, array(204, 304));
  1714 +}
  1715 +public static function closeOutputBuffers($targetLevel, $flush)
  1716 +{
  1717 +$status = ob_get_status(true);
  1718 +$level = count($status);
  1719 +while ($level-- > $targetLevel
  1720 +&& (!empty($status[$level]['del'])
  1721 +|| (isset($status[$level]['flags'])
  1722 +&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)
  1723 +&& ($status[$level]['flags'] & ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE))
  1724 +)
  1725 +)
  1726 +) {
  1727 +if ($flush) {
  1728 +ob_end_flush();
  1729 +} else {
  1730 +ob_end_clean();
  1731 +}
  1732 +}
1648 1733 }
1649 1734 protected function ensureIEOverSSLCompatibility(Request $request)
1650 1735 {
... ... @@ -1857,23 +1942,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
1857 1942 class Container implements IntrospectableContainerInterface
1858 1943 {
1859 1944 protected $parameterBag;
1860   -protected $services;
1861   -protected $methodMap;
1862   -protected $aliases;
1863   -protected $scopes;
1864   -protected $scopeChildren;
1865   -protected $scopedServices;
1866   -protected $scopeStacks;
  1945 +protected $services = array();
  1946 +protected $methodMap = array();
  1947 +protected $aliases = array();
  1948 +protected $scopes = array();
  1949 +protected $scopeChildren = array();
  1950 +protected $scopedServices = array();
  1951 +protected $scopeStacks = array();
1867 1952 protected $loading = array();
1868 1953 public function __construct(ParameterBagInterface $parameterBag = null)
1869 1954 {
1870   -$this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
1871   -$this->services = array();
1872   -$this->aliases = array();
1873   -$this->scopes = array();
1874   -$this->scopeChildren = array();
1875   -$this->scopedServices = array();
1876   -$this->scopeStacks = array();
  1955 +$this->parameterBag = $parameterBag ?: new ParameterBag();
1877 1956 $this->set('service_container', $this);
1878 1957 }
1879 1958 public function compile()
... ... @@ -1907,6 +1986,9 @@ if (self::SCOPE_PROTOTYPE === $scope) {
1907 1986 throw new InvalidArgumentException(sprintf('You cannot set service "%s" of scope "prototype".', $id));
1908 1987 }
1909 1988 $id = strtolower($id);
  1989 +if ('service_container'=== $id) {
  1990 +return;
  1991 +}
1910 1992 if (self::SCOPE_CONTAINER !== $scope) {
1911 1993 if (!isset($this->scopedServices[$scope])) {
1912 1994 throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id));
... ... @@ -1927,6 +2009,9 @@ unset($this-&gt;services[$id]);
1927 2009 public function has($id)
1928 2010 {
1929 2011 $id = strtolower($id);
  2012 +if ('service_container'=== $id) {
  2013 +return true;
  2014 +}
1930 2015 return isset($this->services[$id])
1931 2016 || array_key_exists($id, $this->services)
1932 2017 || isset($this->aliases[$id])
... ... @@ -1939,6 +2024,9 @@ foreach (array(false, true) as $strtolower) {
1939 2024 if ($strtolower) {
1940 2025 $id = strtolower($id);
1941 2026 }
  2027 +if ('service_container'=== $id) {
  2028 +return $this;
  2029 +}
1942 2030 if (isset($this->aliases[$id])) {
1943 2031 $id = $this->aliases[$id];
1944 2032 }
... ... @@ -1966,7 +2054,7 @@ $alternatives[] = $key;
1966 2054 }
1967 2055 throw new ServiceNotFoundException($id, null, null, $alternatives);
1968 2056 }
1969   -return null;
  2057 +return;
1970 2058 }
1971 2059 $this->loading[$id] = true;
1972 2060 try {
... ... @@ -1977,7 +2065,7 @@ if (array_key_exists($id, $this-&gt;services)) {
1977 2065 unset($this->services[$id]);
1978 2066 }
1979 2067 if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
1980   -return null;
  2068 +return;
1981 2069 }
1982 2070 throw $e;
1983 2071 }
... ... @@ -1987,6 +2075,9 @@ return $service;
1987 2075 public function initialized($id)
1988 2076 {
1989 2077 $id = strtolower($id);
  2078 +if ('service_container'=== $id) {
  2079 +return true;
  2080 +}
1990 2081 return isset($this->services[$id]) || array_key_exists($id, $this->services);
1991 2082 }
1992 2083 public function getServiceIds()
... ... @@ -1998,6 +2089,7 @@ if (preg_match(&#39;/^get(.+)Service$/&#39;, $method-&gt;name, $match)) {
1998 2089 $ids[] = self::underscore($match[1]);
1999 2090 }
2000 2091 }
  2092 +$ids[] ='service_container';
2001 2093 return array_unique(array_merge($ids, array_keys($this->services)));
2002 2094 }
2003 2095 public function enterScope($name)
... ... @@ -2160,30 +2252,28 @@ use Symfony\Component\Config\ConfigCache;
2160 2252 use Symfony\Component\ClassLoader\ClassCollectionLoader;
2161 2253 abstract class Kernel implements KernelInterface, TerminableInterface
2162 2254 {
2163   -protected $bundles;
  2255 +protected $bundles = array();
2164 2256 protected $bundleMap;
2165 2257 protected $container;
2166 2258 protected $rootDir;
2167 2259 protected $environment;
2168 2260 protected $debug;
2169   -protected $booted;
  2261 +protected $booted = false;
2170 2262 protected $name;
2171 2263 protected $startTime;
2172 2264 protected $loadClassCache;
2173   -const VERSION ='2.3.10';
2174   -const VERSION_ID ='20310';
  2265 +const VERSION ='2.5.4';
  2266 +const VERSION_ID ='20504';
2175 2267 const MAJOR_VERSION ='2';
2176   -const MINOR_VERSION ='3';
2177   -const RELEASE_VERSION ='10';
  2268 +const MINOR_VERSION ='5';
  2269 +const RELEASE_VERSION ='4';
2178 2270 const EXTRA_VERSION ='';
2179 2271 public function __construct($environment, $debug)
2180 2272 {
2181 2273 $this->environment = $environment;
2182   -$this->debug = (Boolean) $debug;
2183   -$this->booted = false;
  2274 +$this->debug = (bool) $debug;
2184 2275 $this->rootDir = $this->getRootDir();
2185 2276 $this->name = $this->getName();
2186   -$this->bundles = array();
2187 2277 if ($this->debug) {
2188 2278 $this->startTime = microtime(true);
2189 2279 }
... ... @@ -2540,21 +2630,33 @@ return $source;
2540 2630 $rawChunk ='';
2541 2631 $output ='';
2542 2632 $tokens = token_get_all($source);
  2633 +$ignoreSpace = false;
2543 2634 for (reset($tokens); false !== $token = current($tokens); next($tokens)) {
2544 2635 if (is_string($token)) {
2545 2636 $rawChunk .= $token;
2546 2637 } elseif (T_START_HEREDOC === $token[0]) {
2547   -$output .= preg_replace(array('/\s+$/Sm','/\n+/S'),"\n", $rawChunk).$token[1];
  2638 +$output .= $rawChunk.$token[1];
2548 2639 do {
2549 2640 $token = next($tokens);
2550 2641 $output .= $token[1];
2551 2642 } while ($token[0] !== T_END_HEREDOC);
2552 2643 $rawChunk ='';
2553   -} elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
  2644 +} elseif (T_WHITESPACE === $token[0]) {
  2645 +if ($ignoreSpace) {
  2646 +$ignoreSpace = false;
  2647 +continue;
  2648 +}
  2649 +$rawChunk .= preg_replace(array('/\n{2,}/S'),"\n", $token[1]);
  2650 +} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
  2651 +$ignoreSpace = true;
  2652 +} else {
2554 2653 $rawChunk .= $token[1];
  2654 +if (T_OPEN_TAG === $token[0]) {
  2655 +$ignoreSpace = true;
2555 2656 }
2556 2657 }
2557   -$output .= preg_replace(array('/\s+$/Sm','/\n+/S'),"\n", $rawChunk);
  2658 +}
  2659 +$output .= $rawChunk;
2558 2660 return $output;
2559 2661 }
2560 2662 public function serialize()
... ... @@ -2652,8 +2754,8 @@ use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
2652 2754 abstract class Bundle extends ContainerAware implements BundleInterface
2653 2755 {
2654 2756 protected $name;
2655   -protected $reflected;
2656 2757 protected $extension;
  2758 +protected $path;
2657 2759 public function boot()
2658 2760 {
2659 2761 }
... ... @@ -2687,21 +2789,19 @@ return $this-&gt;extension;
2687 2789 }
2688 2790 public function getNamespace()
2689 2791 {
2690   -if (null === $this->reflected) {
2691   -$this->reflected = new \ReflectionObject($this);
2692   -}
2693   -return $this->reflected->getNamespaceName();
  2792 +$class = get_class($this);
  2793 +return substr($class, 0, strrpos($class,'\\'));
2694 2794 }
2695 2795 public function getPath()
2696 2796 {
2697   -if (null === $this->reflected) {
2698   -$this->reflected = new \ReflectionObject($this);
  2797 +if (null === $this->path) {
  2798 +$reflected = new \ReflectionObject($this);
  2799 +$this->path = dirname($reflected->getFileName());
2699 2800 }
2700   -return dirname($this->reflected->getFileName());
  2801 +return $this->path;
2701 2802 }
2702 2803 public function getParent()
2703 2804 {
2704   -return null;
2705 2805 }
2706 2806 final public function getName()
2707 2807 {
... ... @@ -2725,7 +2825,14 @@ $ns = $prefix;
2725 2825 if ($relativePath = $file->getRelativePath()) {
2726 2826 $ns .='\\'.strtr($relativePath,'/','\\');
2727 2827 }
2728   -$r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));
  2828 +$class = $ns.'\\'.$file->getBasename('.php');
  2829 +if ($this->container) {
  2830 +$alias ='console.command.'.strtolower(str_replace('\\','_', $class));
  2831 +if ($this->container->has($alias)) {
  2832 +continue;
  2833 +}
  2834 +}
  2835 +$r = new \ReflectionClass($class);
2729 2836 if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
2730 2837 $application->add($r->newInstance());
2731 2838 }
... ... @@ -2736,6 +2843,7 @@ $application-&gt;add($r-&gt;newInstance());
2736 2843 namespace Symfony\Component\Config
2737 2844 {
2738 2845 use Symfony\Component\Config\Resource\ResourceInterface;
  2846 +use Symfony\Component\Filesystem\Exception\IOException;
2739 2847 use Symfony\Component\Filesystem\Filesystem;
2740 2848 class ConfigCache
2741 2849 {
... ... @@ -2744,7 +2852,7 @@ private $file;
2744 2852 public function __construct($file, $debug)
2745 2853 {
2746 2854 $this->file = $file;
2747   -$this->debug = (Boolean) $debug;
  2855 +$this->debug = (bool) $debug;
2748 2856 }
2749 2857 public function __toString()
2750 2858 {
... ... @@ -2773,11 +2881,20 @@ return true;
2773 2881 }
2774 2882 public function write($content, array $metadata = null)
2775 2883 {
2776   -$mode = 0666 & ~umask();
  2884 +$mode = 0666;
  2885 +$umask = umask();
2777 2886 $filesystem = new Filesystem();
2778   -$filesystem->dumpFile($this->file, $content, $mode);
  2887 +$filesystem->dumpFile($this->file, $content, null);
  2888 +try {
  2889 +$filesystem->chmod($this->file, $mode, $umask);
  2890 +} catch (IOException $e) {
  2891 +}
2779 2892 if (null !== $metadata && true === $this->debug) {
2780   -$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), $mode);
  2893 +$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null);
  2894 +try {
  2895 +$filesystem->chmod($this->getMetaFile(), $mode, $umask);
  2896 +} catch (IOException $e) {
  2897 +}
2781 2898 }
2782 2899 }
2783 2900 private function getMetaFile()
... ... @@ -2793,21 +2910,25 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2793 2910 use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
2794 2911 use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
2795 2912 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
  2913 +use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
2796 2914 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
2797 2915 use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
2798 2916 use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
2799 2917 use Symfony\Component\HttpKernel\Event\PostResponseEvent;
2800 2918 use Symfony\Component\HttpFoundation\Request;
  2919 +use Symfony\Component\HttpFoundation\RequestStack;
2801 2920 use Symfony\Component\HttpFoundation\Response;
2802 2921 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2803 2922 class HttpKernel implements HttpKernelInterface, TerminableInterface
2804 2923 {
2805 2924 protected $dispatcher;
2806 2925 protected $resolver;
2807   -public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver)
  2926 +protected $requestStack;
  2927 +public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null)
2808 2928 {
2809 2929 $this->dispatcher = $dispatcher;
2810 2930 $this->resolver = $resolver;
  2931 +$this->requestStack = $requestStack ?: new RequestStack();
2811 2932 }
2812 2933 public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
2813 2934 {
... ... @@ -2815,6 +2936,7 @@ try {
2815 2936 return $this->handleRaw($request, $type);
2816 2937 } catch (\Exception $e) {
2817 2938 if (false === $catch) {
  2939 +$this->finishRequest($request, $type);
2818 2940 throw $e;
2819 2941 }
2820 2942 return $this->handleException($e, $request, $type);
... ... @@ -2824,8 +2946,19 @@ public function terminate(Request $request, Response $response)
2824 2946 {
2825 2947 $this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response));
2826 2948 }
  2949 +public function terminateWithException(\Exception $exception)
  2950 +{
  2951 +if (!$request = $this->requestStack->getMasterRequest()) {
  2952 +throw new \LogicException('Request stack is empty', 0, $exception);
  2953 +}
  2954 +$response = $this->handleException($exception, $request, self::MASTER_REQUEST);
  2955 +$response->sendHeaders();
  2956 +$response->sendContent();
  2957 +$this->terminate($request, $response);
  2958 +}
2827 2959 private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
2828 2960 {
  2961 +$this->requestStack->push($request);
2829 2962 $event = new GetResponseEvent($this, $request, $type);
2830 2963 $this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
2831 2964 if ($event->hasResponse()) {
... ... @@ -2859,14 +2992,21 @@ private function filterResponse(Response $response, Request $request, $type)
2859 2992 {
2860 2993 $event = new FilterResponseEvent($this, $request, $type, $response);
2861 2994 $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
  2995 +$this->finishRequest($request, $type);
2862 2996 return $event->getResponse();
2863 2997 }
  2998 +private function finishRequest(Request $request, $type)
  2999 +{
  3000 +$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type));
  3001 +$this->requestStack->pop();
  3002 +}
2864 3003 private function handleException(\Exception $e, $request, $type)
2865 3004 {
2866 3005 $event = new GetResponseForExceptionEvent($this, $request, $type, $e);
2867 3006 $this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
2868 3007 $e = $event->getException();
2869 3008 if (!$event->hasResponse()) {
  3009 +$this->finishRequest($request, $type);
2870 3010 throw $e;
2871 3011 }
2872 3012 $response = $event->getResponse();
... ... @@ -2918,6 +3058,7 @@ return (string) $var;
2918 3058 namespace Symfony\Component\HttpKernel\DependencyInjection
2919 3059 {
2920 3060 use Symfony\Component\HttpFoundation\Request;
  3061 +use Symfony\Component\HttpFoundation\RequestStack;
2921 3062 use Symfony\Component\HttpKernel\HttpKernelInterface;
2922 3063 use Symfony\Component\HttpKernel\HttpKernel;
2923 3064 use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
... ... @@ -2927,9 +3068,9 @@ use Symfony\Component\DependencyInjection\Scope;
2927 3068 class ContainerAwareHttpKernel extends HttpKernel
2928 3069 {
2929 3070 protected $container;
2930   -public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)
  3071 +public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null)
2931 3072 {
2932   -parent::__construct($dispatcher, $controllerResolver);
  3073 +parent::__construct($dispatcher, $controllerResolver, $requestStack);
2933 3074 $this->container = $container;
2934 3075 if (!$container->hasScope('request')) {
2935 3076 $container->addScope(new Scope('request'));
... ...
app/config/config.yml
... ... @@ -14,8 +14,8 @@ framework:
14 14 validation: { enable_annotations: true }
15 15 templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
16 16 default_locale: "%locale%"
17   -# trusted_proxies: ~
18 17 session: ~
  18 +# trusted_proxies: ~
19 19 # session:
20 20 # handler_id: session.handler.pdo
21 21  
... ... @@ -26,6 +26,7 @@ parameters:
26 26 db_data_col: session_value
27 27 db_time_col: session_time
28 28  
  29 +
29 30 # Twig Configuration
30 31 twig:
31 32 debug: "%kernel.debug%"
... ... @@ -152,14 +153,35 @@ knp_paginator:
152 153  
153 154 # Configuration for FMElFinderBundle
154 155 fm_elfinder:
155   - locale: %locale%
156   - editor: simple
157   - compression: false
158   - connector:
159   - roots:
160   - downloads:
161   - driver: elfinder.driver.filesystem
162   - 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']
163 185  
164 186 jms_translation:
165 187 configs:
... ... @@ -167,14 +189,14 @@ jms_translation:
167 189 dirs: [%kernel.root_dir%, %kernel.root_dir%/../app]
168 190 output_dir: %kernel.root_dir%/Resources/translations
169 191 ignored_domains: [routes]
170   - excluded_names: [*TestCase.php, *Test.php]
  192 + excluded_names: ["*TestCase.php", "*Test.php"]
171 193 excluded_dirs: [cache, data, logs]
172 194 #extractors: [alias_of_the_extractor]
173 195 src:
174 196 dirs: [%kernel.root_dir%, %kernel.root_dir%/../src]
175 197 output_dir: %kernel.root_dir%/../src/Cacic/CommonBundle/Resources/translations
176 198 ignored_domains: [routes]
177   - excluded_names: [*TestCase.php, *Test.php]
  199 + excluded_names: ["*TestCase.php", "*Test.php"]
178 200 excluded_dirs: [Common, Entity, Form]
179 201 #extractors: [alias_of_the_extractor]
180 202  
... ... @@ -211,3 +233,7 @@ services:
211 233 session.handler.pdo:
212 234 class: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
213 235 arguments: ["@pdo", "%pdo.db_options%"]
  236 +
  237 + apikey_authenticator:
  238 + class: Cacic\WSBundle\Security\ApiKeyAuthenticator
  239 + arguments: ["@webservice_user_provider"]
214 240 \ No newline at end of file
... ...
app/config/config_test.yml
... ... @@ -4,7 +4,19 @@ imports:
4 4 framework:
5 5 test: ~
6 6 session:
7   - storage_id: session.storage.mock_file
  7 + storage_id: session.storage.filesystem
  8 +
  9 +doctrine:
  10 + dbal:
  11 + default_connection: default
  12 + connections:
  13 + default:
  14 + driver: pdo_sqlite
  15 + path: %kernel.cache_dir%/test.db
  16 + charset: UTF8
  17 +
  18 +liip_functional_test:
  19 + cache_sqlite_db: true
8 20  
9 21 web_profiler:
10 22 toolbar: false
... ... @@ -12,3 +24,9 @@ web_profiler:
12 24  
13 25 swiftmailer:
14 26 disable_delivery: true
  27 +
  28 +# Adiciona autenticação HTTP para as requisições de teste
  29 +security:
  30 + firewalls:
  31 + main:
  32 + http_basic: ~
15 33 \ No newline at end of file
... ...
app/config/security.yml
... ... @@ -16,11 +16,20 @@ security:
16 16 providers:
17 17 main:
18 18 entity: { class: Cacic\CommonBundle\Entity\Usuario, property: nmUsuarioAcesso }
  19 + webservice:
  20 + id: webservice_user_provider
19 21  
20 22 firewalls:
21 23 dev:
22 24 pattern: ^/(_(profiler|wdt)|css|images|js|assets|assetic)/
23 25 security: false
  26 +
  27 + ws_neo:
  28 + pattern: ^/ws/neo/getLogin
  29 + stateless: false
  30 + simple_preauth:
  31 + authenticator: apikey_authenticator
  32 +
24 33 login:
25 34 pattern: ^/login$
26 35 security: false
... ... @@ -51,6 +60,8 @@ security:
51 60 - { path: ^/cocar/api, roles: IS_AUTHENTICATED_ANONYMOUSLY }
52 61 - { path: ^/ws, roles: IS_AUTHENTICATED_ANONYMOUSLY }
53 62 - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
54   - - { path: ^/, roles: ROLE_ADMIN }
55   - - { path: ^/efconnect, role: ROLE_USER }
56   - - { 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
... ... @@ -24,20 +24,21 @@
24 24 ],
25 25 "require": {
26 26 "php": ">=5.3.3",
27   - "symfony/symfony": "2.3.10",
  27 + "symfony/symfony": "~2.5",
  28 + "symfony/icu": "1.1.*",
28 29 "jquery/jquery": "1.10.*",
29   - "doctrine/orm": ">=2.2.3,<2.4-dev",
  30 + "doctrine/orm": "~2.4",
30 31 "doctrine/doctrine-bundle": "1.2.*",
31   - "twig/extensions": "1.0.*",
32   - "symfony/assetic-bundle": "2.3.*",
33   - "symfony/swiftmailer-bundle": "2.3.*",
34   - "symfony/monolog-bundle": "2.3.*",
35   - "sensio/distribution-bundle": "2.3.*",
36   - "sensio/framework-extra-bundle": "2.3.*",
37   - "sensio/generator-bundle": "2.3.*",
  32 + "twig/extensions": "~1.1",
  33 + "symfony/assetic-bundle": "~2.3",
  34 + "symfony/swiftmailer-bundle": "~2.3",
  35 + "symfony/monolog-bundle": "~2.6",
  36 + "sensio/distribution-bundle": "~2.3",
  37 + "sensio/framework-extra-bundle": "~2.3",
  38 + "sensio/generator-bundle": "~2.4",
38 39 "incenteev/composer-parameter-handler": "~2.0",
39   - "symfony/finder": "2.3.*",
40   - "jms/security-extra-bundle": "1.5.*",
  40 + "symfony/finder": "~2.3",
  41 + "jms/security-extra-bundle": "~1.5",
41 42 "jms/di-extra-bundle": "1.4.*",
42 43 "kriswallsmith/assetic": "v1.1.1",
43 44 "braincrafted/bootstrap-bundle": "~2.0",
... ... @@ -47,11 +48,12 @@
47 48 "doctrine/doctrine-fixtures-bundle": "dev-master",
48 49 "ijanki/ftp-bundle": "*",
49 50 "jms/translation-bundle": "1.1.*@dev",
50   - "helios-ag/fm-elfinder-bundle": "1.x",
51   - "knplabs/knp-menu": "2.0.0-alpha1",
52   - "knplabs/knp-menu-bundle": "2.0.0-alpha1",
  51 + "helios-ag/fm-elfinder-bundle": "~2.5",
  52 + "helios-ag/fm-elfinder-php-connector": "~2.0",
  53 + "knplabs/knp-menu": "~2.0",
  54 + "knplabs/knp-menu-bundle": "~2.0",
53 55 "jpgraph/jpgraph": "dev-master",
54   - "symfony/class-loader": "2.2.*",
  56 + "symfony/class-loader": "~2.3",
55 57 "friendsofsymfony/rest-bundle": "dev-master",
56 58 "jms/serializer": "0.14.*@dev",
57 59 "jms/serializer-bundle": "0.13.*@dev",
... ... @@ -60,7 +62,8 @@
60 62 "ddeboer/data-import-bundle": "dev-master",
61 63 "twbs/bootstrap": "3.0.*",
62 64 "doctrine/migrations": "dev-master",
63   - "doctrine/doctrine-migrations-bundle": "dev-master"
  65 + "doctrine/doctrine-migrations-bundle": "dev-master",
  66 + "liip/functional-test-bundle": "~1.0"
64 67 },
65 68 "scripts": {
66 69 "post-install-cmd": [
... ...
composer.lock
... ... @@ -4,21 +4,21 @@
4 4 "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 5 "This file is @generated automatically"
6 6 ],
7   - "hash": "4ce2775488ee172a7deb32d74d4dbf59",
  7 + "hash": "0c0ea7f959a9dbd4dffb990bf8eda3ee",
8 8 "packages": [
9 9 {
10 10 "name": "braincrafted/bootstrap-bundle",
11   - "version": "v2.0.1",
  11 + "version": "v2.1.0",
12 12 "target-dir": "Braincrafted/Bundle/BootstrapBundle",
13 13 "source": {
14 14 "type": "git",
15 15 "url": "https://github.com/braincrafted/bootstrap-bundle.git",
16   - "reference": "dc6169b1e29d8668cda960aa663fcc4bbd602bd4"
  16 + "reference": "56231594bfce2b4fd293592662f508becc4c494e"
17 17 },
18 18 "dist": {
19 19 "type": "zip",
20   - "url": "https://api.github.com/repos/braincrafted/bootstrap-bundle/zipball/dc6169b1e29d8668cda960aa663fcc4bbd602bd4",
21   - "reference": "dc6169b1e29d8668cda960aa663fcc4bbd602bd4",
  20 + "url": "https://api.github.com/repos/braincrafted/bootstrap-bundle/zipball/56231594bfce2b4fd293592662f508becc4c494e",
  21 + "reference": "56231594bfce2b4fd293592662f508becc4c494e",
22 22 "shasum": ""
23 23 },
24 24 "require": {
... ... @@ -57,15 +57,14 @@
57 57 {
58 58 "name": "Florian Eckerstorfer",
59 59 "email": "florian@eckerstorfer.co",
60   - "homepage": "http://florian.ec",
61   - "role": "Developer"
  60 + "homepage": "http://florian.ec"
62 61 }
63 62 ],
64 63 "description": "BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.",
65 64 "keywords": [
66 65 "bootstrap"
67 66 ],
68   - "time": "2014-04-03 16:59:23"
  67 + "time": "2014-08-31 10:47:30"
69 68 },
70 69 {
71 70 "name": "ddeboer/data-import",
... ... @@ -183,16 +182,16 @@
183 182 },
184 183 {
185 184 "name": "doctrine/annotations",
186   - "version": "v1.2.0",
  185 + "version": "v1.2.1",
187 186 "source": {
188 187 "type": "git",
189 188 "url": "https://github.com/doctrine/annotations.git",
190   - "reference": "d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd"
  189 + "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633"
191 190 },
192 191 "dist": {
193 192 "type": "zip",
194   - "url": "https://api.github.com/repos/doctrine/annotations/zipball/d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd",
195   - "reference": "d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd",
  193 + "url": "https://api.github.com/repos/doctrine/annotations/zipball/6a6bec0670bb6e71a263b08bc1b98ea242928633",
  194 + "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633",
196 195 "shasum": ""
197 196 },
198 197 "require": {
... ... @@ -220,17 +219,6 @@
220 219 ],
221 220 "authors": [
222 221 {
223   - "name": "Jonathan Wage",
224   - "email": "jonwage@gmail.com",
225   - "homepage": "http://www.jwage.com/",
226   - "role": "Creator"
227   - },
228   - {
229   - "name": "Guilherme Blanco",
230   - "email": "guilhermeblanco@gmail.com",
231   - "homepage": "http://www.instaclick.com"
232   - },
233   - {
234 222 "name": "Roman Borschel",
235 223 "email": "roman@code-factory.org"
236 224 },
... ... @@ -239,10 +227,16 @@
239 227 "email": "kontakt@beberlei.de"
240 228 },
241 229 {
  230 + "name": "Guilherme Blanco",
  231 + "email": "guilhermeblanco@gmail.com"
  232 + },
  233 + {
  234 + "name": "Jonathan Wage",
  235 + "email": "jonwage@gmail.com"
  236 + },
  237 + {
242 238 "name": "Johannes Schmitt",
243   - "email": "schmittjoh@gmail.com",
244   - "homepage": "http://jmsyst.com",
245   - "role": "Developer of wrapped JMSSerializerBundle"
  239 + "email": "schmittjoh@gmail.com"
246 240 }
247 241 ],
248 242 "description": "Docblock Annotations Parser",
... ... @@ -252,20 +246,20 @@
252 246 "docblock",
253 247 "parser"
254 248 ],
255   - "time": "2014-07-06 15:52:21"
  249 + "time": "2014-09-25 16:45:30"
256 250 },
257 251 {
258 252 "name": "doctrine/cache",
259   - "version": "v1.3.0",
  253 + "version": "v1.3.1",
260 254 "source": {
261 255 "type": "git",
262 256 "url": "https://github.com/doctrine/cache.git",
263   - "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449"
  257 + "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7"
264 258 },
265 259 "dist": {
266 260 "type": "zip",
267   - "url": "https://api.github.com/repos/doctrine/cache/zipball/e16d7adf45664a50fa86f515b6d5e7f670130449",
268   - "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449",
  261 + "url": "https://api.github.com/repos/doctrine/cache/zipball/cf483685798a72c93bf4206e3dd6358ea07d64e7",
  262 + "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7",
269 263 "shasum": ""
270 264 },
271 265 "require": {
... ... @@ -281,7 +275,7 @@
281 275 "type": "library",
282 276 "extra": {
283 277 "branch-alias": {
284   - "dev-master": "1.0.x-dev"
  278 + "dev-master": "1.4.x-dev"
285 279 }
286 280 },
287 281 "autoload": {
... ... @@ -295,17 +289,6 @@
295 289 ],
296 290 "authors": [
297 291 {
298   - "name": "Jonathan Wage",
299   - "email": "jonwage@gmail.com",
300   - "homepage": "http://www.jwage.com/",
301   - "role": "Creator"
302   - },
303   - {
304   - "name": "Guilherme Blanco",
305   - "email": "guilhermeblanco@gmail.com",
306   - "homepage": "http://www.instaclick.com"
307   - },
308   - {
309 292 "name": "Roman Borschel",
310 293 "email": "roman@code-factory.org"
311 294 },
... ... @@ -314,10 +297,16 @@
314 297 "email": "kontakt@beberlei.de"
315 298 },
316 299 {
317   - "name": "Johannes M. Schmitt",
318   - "email": "schmittjoh@gmail.com",
319   - "homepage": "https://github.com/schmittjoh",
320   - "role": "Developer of wrapped JMSSerializerBundle"
  300 + "name": "Guilherme Blanco",
  301 + "email": "guilhermeblanco@gmail.com"
  302 + },
  303 + {
  304 + "name": "Jonathan Wage",
  305 + "email": "jonwage@gmail.com"
  306 + },
  307 + {
  308 + "name": "Johannes Schmitt",
  309 + "email": "schmittjoh@gmail.com"
321 310 }
322 311 ],
323 312 "description": "Caching library offering an object-oriented API for many cache backends",
... ... @@ -326,7 +315,7 @@
326 315 "cache",
327 316 "caching"
328 317 ],
329   - "time": "2013-10-25 19:04:14"
  318 + "time": "2014-09-17 14:24:04"
330 319 },
331 320 {
332 321 "name": "doctrine/collections",
... ... @@ -381,7 +370,7 @@
381 370 "email": "kontakt@beberlei.de"
382 371 },
383 372 {
384   - "name": "Johannes M. Schmitt",
  373 + "name": "Johannes Schmitt",
385 374 "email": "schmittjoh@gmail.com",
386 375 "homepage": "https://github.com/schmittjoh",
387 376 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -459,7 +448,7 @@
459 448 {
460 449 "name": "Johannes Schmitt",
461 450 "email": "schmittjoh@gmail.com",
462   - "homepage": "http://jmsyst.com",
  451 + "homepage": "https://github.com/schmittjoh",
463 452 "role": "Developer of wrapped JMSSerializerBundle"
464 453 }
465 454 ],
... ... @@ -480,12 +469,12 @@
480 469 "source": {
481 470 "type": "git",
482 471 "url": "https://github.com/doctrine/data-fixtures.git",
483   - "reference": "e847b073c2b5350045edbb40443645ad09a59538"
  472 + "reference": "ac36ccc812454e057aec564e0725509e74ce6b35"
484 473 },
485 474 "dist": {
486 475 "type": "zip",
487   - "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/e847b073c2b5350045edbb40443645ad09a59538",
488   - "reference": "e847b073c2b5350045edbb40443645ad09a59538",
  476 + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/ac36ccc812454e057aec564e0725509e74ce6b35",
  477 + "reference": "ac36ccc812454e057aec564e0725509e74ce6b35",
489 478 "shasum": ""
490 479 },
491 480 "require": {
... ... @@ -518,9 +507,7 @@
518 507 "authors": [
519 508 {
520 509 "name": "Jonathan Wage",
521   - "email": "jonwage@gmail.com",
522   - "homepage": "http://www.jwage.com/",
523   - "role": "Creator"
  510 + "email": "jonwage@gmail.com"
524 511 }
525 512 ],
526 513 "description": "Data Fixtures for all Doctrine Object Managers",
... ... @@ -528,35 +515,37 @@
528 515 "keywords": [
529 516 "database"
530 517 ],
531   - "time": "2014-03-13 12:26:17"
  518 + "time": "2014-08-18 12:52:16"
532 519 },
533 520 {
534 521 "name": "doctrine/dbal",
535   - "version": "2.3.4",
  522 + "version": "v2.4.3",
536 523 "source": {
537 524 "type": "git",
538 525 "url": "https://github.com/doctrine/dbal.git",
539   - "reference": "2a37b007dda8e21bdbb8fa445be8fa0064199e13"
  526 + "reference": "0368bc031976126e5d36d37d2c56155092b6575b"
540 527 },
541 528 "dist": {
542 529 "type": "zip",
543   - "url": "https://api.github.com/repos/doctrine/dbal/zipball/2a37b007dda8e21bdbb8fa445be8fa0064199e13",
544   - "reference": "2a37b007dda8e21bdbb8fa445be8fa0064199e13",
  530 + "url": "https://api.github.com/repos/doctrine/dbal/zipball/0368bc031976126e5d36d37d2c56155092b6575b",
  531 + "reference": "0368bc031976126e5d36d37d2c56155092b6575b",
545 532 "shasum": ""
546 533 },
547 534 "require": {
548   - "doctrine/common": ">=2.3.0,<2.5-dev",
  535 + "doctrine/common": "~2.4",
549 536 "php": ">=5.3.2"
550 537 },
551   - "type": "library",
552   - "extra": {
553   - "branch-alias": {
554   - "dev-master": "2.3.x-dev"
555   - }
  538 + "require-dev": {
  539 + "phpunit/phpunit": "3.7.*",
  540 + "symfony/console": "~2.0"
  541 + },
  542 + "suggest": {
  543 + "symfony/console": "For helpful console commands such as SQL execution and import of files."
556 544 },
  545 + "type": "library",
557 546 "autoload": {
558 547 "psr-0": {
559   - "Doctrine\\DBAL": "lib/"
  548 + "Doctrine\\DBAL\\": "lib/"
560 549 }
561 550 },
562 551 "notification-url": "https://packagist.org/downloads/",
... ... @@ -565,23 +554,20 @@
565 554 ],
566 555 "authors": [
567 556 {
568   - "name": "Jonathan Wage",
569   - "email": "jonwage@gmail.com",
570   - "homepage": "http://www.jwage.com/",
571   - "role": "Creator"
572   - },
573   - {
574   - "name": "Guilherme Blanco",
575   - "email": "guilhermeblanco@gmail.com",
576   - "homepage": "http://www.instaclick.com"
577   - },
578   - {
579 557 "name": "Roman Borschel",
580 558 "email": "roman@code-factory.org"
581 559 },
582 560 {
583 561 "name": "Benjamin Eberlei",
584 562 "email": "kontakt@beberlei.de"
  563 + },
  564 + {
  565 + "name": "Guilherme Blanco",
  566 + "email": "guilhermeblanco@gmail.com"
  567 + },
  568 + {
  569 + "name": "Jonathan Wage",
  570 + "email": "jonwage@gmail.com"
585 571 }
586 572 ],
587 573 "description": "Database Abstraction Layer",
... ... @@ -592,7 +578,7 @@
592 578 "persistence",
593 579 "queryobject"
594 580 ],
595   - "time": "2013-05-11 07:45:37"
  581 + "time": "2014-10-16 11:56:49"
596 582 },
597 583 {
598 584 "name": "doctrine/doctrine-bundle",
... ... @@ -673,12 +659,12 @@
673 659 "source": {
674 660 "type": "git",
675 661 "url": "https://github.com/doctrine/DoctrineFixturesBundle.git",
676   - "reference": "ccd69d9ec90013955a412a21125672afc09738dc"
  662 + "reference": "9a5b5289eb22079ec139ba1eb06043d4b89c6677"
677 663 },
678 664 "dist": {
679 665 "type": "zip",
680   - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/ccd69d9ec90013955a412a21125672afc09738dc",
681   - "reference": "ccd69d9ec90013955a412a21125672afc09738dc",
  666 + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/9a5b5289eb22079ec139ba1eb06043d4b89c6677",
  667 + "reference": "9a5b5289eb22079ec139ba1eb06043d4b89c6677",
682 668 "shasum": ""
683 669 },
684 670 "require": {
... ... @@ -704,18 +690,16 @@
704 690 ],
705 691 "authors": [
706 692 {
707   - "name": "Fabien Potencier",
708   - "email": "fabien@symfony.com",
709   - "homepage": "http://fabien.potencier.org",
710   - "role": "Lead Developer"
711   - },
712   - {
713 693 "name": "Symfony Community",
714 694 "homepage": "http://symfony.com/contributors"
715 695 },
716 696 {
717 697 "name": "Doctrine Project",
718 698 "homepage": "http://www.doctrine-project.org"
  699 + },
  700 + {
  701 + "name": "Fabien Potencier",
  702 + "email": "fabien@symfony.com"
719 703 }
720 704 ],
721 705 "description": "Symfony DoctrineFixturesBundle",
... ... @@ -724,7 +708,7 @@
724 708 "Fixture",
725 709 "persistence"
726 710 ],
727   - "time": "2014-03-05 01:11:31"
  711 + "time": "2014-09-16 05:03:04"
728 712 },
729 713 {
730 714 "name": "doctrine/doctrine-migrations-bundle",
... ... @@ -733,12 +717,12 @@
733 717 "source": {
734 718 "type": "git",
735 719 "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git",
736   - "reference": "f7138381aa884c0f679da4de41e369b94ead9cd3"
  720 + "reference": "81575a4316951125ce408c70f30547c77d98f78a"
737 721 },
738 722 "dist": {
739 723 "type": "zip",
740   - "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/f7138381aa884c0f679da4de41e369b94ead9cd3",
741   - "reference": "f7138381aa884c0f679da4de41e369b94ead9cd3",
  724 + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/81575a4316951125ce408c70f30547c77d98f78a",
  725 + "reference": "81575a4316951125ce408c70f30547c77d98f78a",
742 726 "shasum": ""
743 727 },
744 728 "require": {
... ... @@ -764,18 +748,16 @@
764 748 ],
765 749 "authors": [
766 750 {
767   - "name": "Fabien Potencier",
768   - "email": "fabien@symfony.com",
769   - "homepage": "http://fabien.potencier.org",
770   - "role": "Lead Developer"
771   - },
772   - {
773 751 "name": "Symfony Community",
774 752 "homepage": "http://symfony.com/contributors"
775 753 },
776 754 {
777 755 "name": "Doctrine Project",
778 756 "homepage": "http://www.doctrine-project.org"
  757 + },
  758 + {
  759 + "name": "Fabien Potencier",
  760 + "email": "fabien@symfony.com"
779 761 }
780 762 ],
781 763 "description": "Symfony DoctrineMigrationsBundle",
... ... @@ -785,7 +767,7 @@
785 767 "migrations",
786 768 "schema"
787 769 ],
788   - "time": "2014-03-20 14:48:55"
  770 + "time": "2014-08-17 07:53:47"
789 771 },
790 772 {
791 773 "name": "doctrine/inflector",
... ... @@ -835,7 +817,7 @@
835 817 "email": "kontakt@beberlei.de"
836 818 },
837 819 {
838   - "name": "Johannes M. Schmitt",
  820 + "name": "Johannes Schmitt",
839 821 "email": "schmittjoh@gmail.com",
840 822 "homepage": "https://github.com/schmittjoh",
841 823 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -889,7 +871,7 @@
889 871 "email": "roman@code-factory.org"
890 872 },
891 873 {
892   - "name": "Johannes M. Schmitt",
  874 + "name": "Johannes Schmitt",
893 875 "email": "schmittjoh@gmail.com",
894 876 "homepage": "https://github.com/schmittjoh",
895 877 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -909,12 +891,12 @@
909 891 "source": {
910 892 "type": "git",
911 893 "url": "https://github.com/doctrine/migrations.git",
912   - "reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8"
  894 + "reference": "f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0"
913 895 },
914 896 "dist": {
915 897 "type": "zip",
916   - "url": "https://api.github.com/repos/doctrine/migrations/zipball/4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
917   - "reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
  898 + "url": "https://api.github.com/repos/doctrine/migrations/zipball/f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0",
  899 + "reference": "f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0",
918 900 "shasum": ""
919 901 },
920 902 "require": {
... ... @@ -945,14 +927,12 @@
945 927 ],
946 928 "authors": [
947 929 {
948   - "name": "Jonathan Wage",
949   - "email": "jonwage@gmail.com",
950   - "homepage": "http://www.jwage.com/",
951   - "role": "Creator"
952   - },
953   - {
954 930 "name": "Benjamin Eberlei",
955 931 "email": "kontakt@beberlei.de"
  932 + },
  933 + {
  934 + "name": "Jonathan Wage",
  935 + "email": "jonwage@gmail.com"
956 936 }
957 937 ],
958 938 "description": "Database Schema migrations using Doctrine DBAL",
... ... @@ -961,27 +941,32 @@
961 941 "database",
962 942 "migrations"
963 943 ],
964   - "time": "2014-07-09 07:58:02"
  944 + "time": "2014-10-30 14:49:25"
965 945 },
966 946 {
967 947 "name": "doctrine/orm",
968   - "version": "v2.3.6",
  948 + "version": "v2.4.5",
969 949 "source": {
970 950 "type": "git",
971 951 "url": "https://github.com/doctrine/doctrine2.git",
972   - "reference": "c2135b38216c6c8a410e764792aa368e946f2ae5"
  952 + "reference": "c0d3cdbdfbf873871167050ab077e49b1ad02ab0"
973 953 },
974 954 "dist": {
975 955 "type": "zip",
976   - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/c2135b38216c6c8a410e764792aa368e946f2ae5",
977   - "reference": "c2135b38216c6c8a410e764792aa368e946f2ae5",
  956 + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/c0d3cdbdfbf873871167050ab077e49b1ad02ab0",
  957 + "reference": "c0d3cdbdfbf873871167050ab077e49b1ad02ab0",
978 958 "shasum": ""
979 959 },
980 960 "require": {
981   - "doctrine/dbal": "2.3.*",
  961 + "doctrine/collections": "~1.1",
  962 + "doctrine/dbal": "~2.4",
982 963 "ext-pdo": "*",
983 964 "php": ">=5.3.2",
984   - "symfony/console": "2.*"
  965 + "symfony/console": "~2.0"
  966 + },
  967 + "require-dev": {
  968 + "satooshi/php-coveralls": "dev-master",
  969 + "symfony/yaml": "~2.1"
985 970 },
986 971 "suggest": {
987 972 "symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
... ... @@ -993,12 +978,12 @@
993 978 "type": "library",
994 979 "extra": {
995 980 "branch-alias": {
996   - "dev-master": "2.3.x-dev"
  981 + "dev-master": "2.4.x-dev"
997 982 }
998 983 },
999 984 "autoload": {
1000 985 "psr-0": {
1001   - "Doctrine\\ORM": "lib/"
  986 + "Doctrine\\ORM\\": "lib/"
1002 987 }
1003 988 },
1004 989 "notification-url": "https://packagist.org/downloads/",
... ... @@ -1007,23 +992,20 @@
1007 992 ],
1008 993 "authors": [
1009 994 {
1010   - "name": "Jonathan Wage",
1011   - "email": "jonwage@gmail.com",
1012   - "homepage": "http://www.jwage.com/",
1013   - "role": "Creator"
1014   - },
1015   - {
1016   - "name": "Guilherme Blanco",
1017   - "email": "guilhermeblanco@gmail.com",
1018   - "homepage": "http://www.instaclick.com"
1019   - },
1020   - {
1021 995 "name": "Roman Borschel",
1022 996 "email": "roman@code-factory.org"
1023 997 },
1024 998 {
1025 999 "name": "Benjamin Eberlei",
1026 1000 "email": "kontakt@beberlei.de"
  1001 + },
  1002 + {
  1003 + "name": "Guilherme Blanco",
  1004 + "email": "guilhermeblanco@gmail.com"
  1005 + },
  1006 + {
  1007 + "name": "Jonathan Wage",
  1008 + "email": "jonwage@gmail.com"
1027 1009 }
1028 1010 ],
1029 1011 "description": "Object-Relational-Mapper for PHP",
... ... @@ -1032,7 +1014,7 @@
1032 1014 "database",
1033 1015 "orm"
1034 1016 ],
1035   - "time": "2014-06-03 19:53:45"
  1017 + "time": "2014-09-22 21:58:51"
1036 1018 },
1037 1019 {
1038 1020 "name": "friendsofsymfony/rest-bundle",
... ... @@ -1041,17 +1023,17 @@
1041 1023 "source": {
1042 1024 "type": "git",
1043 1025 "url": "https://github.com/FriendsOfSymfony/FOSRestBundle.git",
1044   - "reference": "22d6b2a401b66fb4f18840efc27826de441d902c"
  1026 + "reference": "f5491a956629282c6962a34087d21dd5f86d2d71"
1045 1027 },
1046 1028 "dist": {
1047 1029 "type": "zip",
1048   - "url": "https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/zipball/22d6b2a401b66fb4f18840efc27826de441d902c",
1049   - "reference": "22d6b2a401b66fb4f18840efc27826de441d902c",
  1030 + "url": "https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/zipball/f5491a956629282c6962a34087d21dd5f86d2d71",
  1031 + "reference": "f5491a956629282c6962a34087d21dd5f86d2d71",
1050 1032 "shasum": ""
1051 1033 },
1052 1034 "require": {
1053   - "doctrine/inflector": "1.0.*",
1054   - "php": ">=5.3.2",
  1035 + "doctrine/inflector": "~1.0",
  1036 + "php": ">=5.3.9",
1055 1037 "psr/log": "~1.0",
1056 1038 "symfony/framework-bundle": "~2.2",
1057 1039 "willdurand/jsonp-callback-validator": "~1.0",
... ... @@ -1079,7 +1061,7 @@
1079 1061 "type": "symfony-bundle",
1080 1062 "extra": {
1081 1063 "branch-alias": {
1082   - "dev-master": "1.4-dev"
  1064 + "dev-master": "1.5-dev"
1083 1065 }
1084 1066 },
1085 1067 "autoload": {
... ... @@ -1110,38 +1092,43 @@
1110 1092 "keywords": [
1111 1093 "rest"
1112 1094 ],
1113   - "time": "2014-08-11 13:50:52"
  1095 + "time": "2014-10-20 12:40:34"
1114 1096 },
1115 1097 {
1116 1098 "name": "helios-ag/fm-elfinder-bundle",
1117   - "version": "1.5",
1118   - "target-dir": "FM/ElfinderBundle",
  1099 + "version": "2.5",
1119 1100 "source": {
1120 1101 "type": "git",
1121 1102 "url": "https://github.com/helios-ag/FMElfinderBundle.git",
1122   - "reference": "57de87e1bf72f9a87fa1d7cd508e7857a3d03860"
  1103 + "reference": "955e8ec9ed63605f0aeedd2db99dc33818e0ddc8"
1123 1104 },
1124 1105 "dist": {
1125 1106 "type": "zip",
1126   - "url": "https://api.github.com/repos/helios-ag/FMElfinderBundle/zipball/57de87e1bf72f9a87fa1d7cd508e7857a3d03860",
1127   - "reference": "57de87e1bf72f9a87fa1d7cd508e7857a3d03860",
  1107 + "url": "https://api.github.com/repos/helios-ag/FMElfinderBundle/zipball/955e8ec9ed63605f0aeedd2db99dc33818e0ddc8",
  1108 + "reference": "955e8ec9ed63605f0aeedd2db99dc33818e0ddc8",
1128 1109 "shasum": ""
1129 1110 },
1130 1111 "require": {
1131   - "helios-ag/fm-elfinder-php-connector": "1.1.1",
  1112 + "helios-ag/fm-elfinder-php-connector": "~2.0",
1132 1113 "php": ">=5.3.3",
1133   - "sensio/framework-extra-bundle": "*@dev",
1134   - "symfony/symfony": "*@stable",
1135   - "symfony/twig-bundle": "~2.0"
  1114 + "symfony/framework-bundle": "~2.4",
  1115 + "symfony/twig-bundle": "~2.4"
  1116 + },
  1117 + "require-dev": {
  1118 + "doctrine/doctrine-bundle": "~1.0",
  1119 + "matthiasnoback/symfony-config-test": "0.*",
  1120 + "matthiasnoback/symfony-dependency-injection-test": "0.*",
  1121 + "symfony/form": "~2.1"
1136 1122 },
1137 1123 "suggest": {
1138   - "Trsteel/ckeditor-bundle": "CKEditor WYSIWYG Editor Bundlefor Symfony2 Project by Trsteel",
1139   - "stfalcon/tinymce-bundle": "TinyMCE WYSIWYG Editor Bundle by Stfalcon"
  1124 + "egeloen/ckeditor-bundle": "CKEditor Bundle by Egeloen",
  1125 + "stfalcon/tinymce-bundle": "TinyMCE Bundle by Stfalcon",
  1126 + "trsteel/ckeditor-bundle": "CKEditor Bundle by trsteel"
1140 1127 },
1141 1128 "type": "symfony-bundle",
1142 1129 "autoload": {
1143   - "psr-0": {
1144   - "FM\\ElfinderBundle": ""
  1130 + "psr-4": {
  1131 + "FM\\ElfinderBundle\\": ""
1145 1132 }
1146 1133 },
1147 1134 "notification-url": "https://packagist.org/downloads/",
... ... @@ -1158,35 +1145,39 @@
1158 1145 "homepage": "https://github.com/helios-ag/FMElfinderBundle/contributors"
1159 1146 }
1160 1147 ],
1161   - "description": "ElFinder bundle, add ElFinder file manager to your Symfony2 project",
  1148 + "description": "ElFinder bundle, adds ElFinder file manager to your Symfony2 project",
1162 1149 "homepage": "https://github.com/helios-ag/FMElfinderBundle",
1163 1150 "keywords": [
1164 1151 "elfinder",
1165 1152 "file manager"
1166 1153 ],
1167   - "time": "2014-05-09 12:02:28"
  1154 + "time": "2014-10-11 09:18:19"
1168 1155 },
1169 1156 {
1170 1157 "name": "helios-ag/fm-elfinder-php-connector",
1171   - "version": "1.1.1",
  1158 + "version": "2.1",
1172 1159 "source": {
1173 1160 "type": "git",
1174 1161 "url": "https://github.com/helios-ag/ElFinderPHP.git",
1175   - "reference": "fa24c5ce710ec2c9eab899786c93dfac1a232386"
  1162 + "reference": "928d58b4a76d08c3c52b5a911500b0311b518802"
1176 1163 },
1177 1164 "dist": {
1178 1165 "type": "zip",
1179   - "url": "https://api.github.com/repos/helios-ag/ElFinderPHP/zipball/fa24c5ce710ec2c9eab899786c93dfac1a232386",
1180   - "reference": "fa24c5ce710ec2c9eab899786c93dfac1a232386",
  1166 + "url": "https://api.github.com/repos/helios-ag/ElFinderPHP/zipball/928d58b4a76d08c3c52b5a911500b0311b518802",
  1167 + "reference": "928d58b4a76d08c3c52b5a911500b0311b518802",
1181 1168 "shasum": ""
1182 1169 },
1183 1170 "require": {
1184   - "php": ">=5.3.0"
  1171 + "php": ">=5.3.3"
  1172 + },
  1173 + "suggest": {
  1174 + "aws/aws-sdk-php": "Allows you to use AWS S3 storage",
  1175 + "dropbox-php/dropbox-php": "Allows you to use Dropbox storage"
1185 1176 },
1186 1177 "type": "library",
1187 1178 "autoload": {
1188   - "psr-0": {
1189   - "FM\\ElFinderPHP": "src/"
  1179 + "psr-4": {
  1180 + "FM\\ElFinderPHP\\": "src/"
1190 1181 }
1191 1182 },
1192 1183 "notification-url": "https://packagist.org/downloads/",
... ... @@ -1195,7 +1186,7 @@
1195 1186 ],
1196 1187 "authors": [
1197 1188 {
1198   - "name": "Albert Ganiev",
  1189 + "name": "Al Ganiev",
1199 1190 "email": "helios.ag@gmail.com"
1200 1191 },
1201 1192 {
... ... @@ -1213,7 +1204,7 @@
1213 1204 "elfinder",
1214 1205 "filemanager"
1215 1206 ],
1216   - "time": "2013-08-06 17:02:04"
  1207 + "time": "2014-10-17 10:43:45"
1217 1208 },
1218 1209 {
1219 1210 "name": "ijanki/ftp-bundle",
... ... @@ -1396,9 +1387,9 @@
1396 1387 ],
1397 1388 "authors": [
1398 1389 {
1399   - "name": "Johannes M. Schmitt",
  1390 + "name": "Johannes Schmitt",
1400 1391 "email": "schmittjoh@gmail.com",
1401   - "homepage": "http://jmsyst.com",
  1392 + "homepage": "https://github.com/schmittjoh",
1402 1393 "role": "Developer of wrapped JMSSerializerBundle"
1403 1394 }
1404 1395 ],
... ... @@ -1438,7 +1429,7 @@
1438 1429 ],
1439 1430 "authors": [
1440 1431 {
1441   - "name": "Johannes M. Schmitt",
  1432 + "name": "Johannes Schmitt",
1442 1433 "email": "schmittjoh@gmail.com",
1443 1434 "homepage": "https://github.com/schmittjoh",
1444 1435 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -1503,9 +1494,9 @@
1503 1494 ],
1504 1495 "authors": [
1505 1496 {
1506   - "name": "Johannes M. Schmitt",
  1497 + "name": "Johannes Schmitt",
1507 1498 "email": "schmittjoh@gmail.com",
1508   - "homepage": "http://jmsyst.com",
  1499 + "homepage": "https://github.com/schmittjoh",
1509 1500 "role": "Developer of wrapped JMSSerializerBundle"
1510 1501 }
1511 1502 ],
... ... @@ -1554,9 +1545,9 @@
1554 1545 ],
1555 1546 "authors": [
1556 1547 {
1557   - "name": "Johannes M. Schmitt",
  1548 + "name": "Johannes Schmitt",
1558 1549 "email": "schmittjoh@gmail.com",
1559   - "homepage": "http://jmsyst.com",
  1550 + "homepage": "https://github.com/schmittjoh",
1560 1551 "role": "Developer of wrapped JMSSerializerBundle"
1561 1552 }
1562 1553 ],
... ... @@ -1658,9 +1649,9 @@
1658 1649 ],
1659 1650 "authors": [
1660 1651 {
1661   - "name": "Johannes M. Schmitt",
  1652 + "name": "Johannes Schmitt",
1662 1653 "email": "schmittjoh@gmail.com",
1663   - "homepage": "http://jmsyst.com",
  1654 + "homepage": "https://github.com/schmittjoh",
1664 1655 "role": "Developer of wrapped JMSSerializerBundle"
1665 1656 }
1666 1657 ],
... ... @@ -1728,9 +1719,9 @@
1728 1719 ],
1729 1720 "authors": [
1730 1721 {
1731   - "name": "Johannes M. Schmitt",
  1722 + "name": "Johannes Schmitt",
1732 1723 "email": "schmittjoh@gmail.com",
1733   - "homepage": "http://jmsyst.com",
  1724 + "homepage": "https://github.com/schmittjoh",
1734 1725 "role": "Developer of wrapped JMSSerializerBundle"
1735 1726 }
1736 1727 ],
... ... @@ -1752,12 +1743,12 @@
1752 1743 "source": {
1753 1744 "type": "git",
1754 1745 "url": "https://github.com/schmittjoh/JMSSerializerBundle.git",
1755   - "reference": "3a980e5409aa3d143534e68a72895e7e33b64c75"
  1746 + "reference": "05965e02bad0922846f010e6ea4c7508549cf20b"
1756 1747 },
1757 1748 "dist": {
1758 1749 "type": "zip",
1759   - "url": "https://api.github.com/repos/schmittjoh/JMSSerializerBundle/zipball/3a980e5409aa3d143534e68a72895e7e33b64c75",
1760   - "reference": "3a980e5409aa3d143534e68a72895e7e33b64c75",
  1750 + "url": "https://api.github.com/repos/schmittjoh/JMSSerializerBundle/zipball/05965e02bad0922846f010e6ea4c7508549cf20b",
  1751 + "reference": "05965e02bad0922846f010e6ea4c7508549cf20b",
1761 1752 "shasum": ""
1762 1753 },
1763 1754 "require": {
... ... @@ -1811,7 +1802,7 @@
1811 1802 "serialization",
1812 1803 "xml"
1813 1804 ],
1814   - "time": "2014-08-07 13:20:59"
  1805 + "time": "2014-09-25 09:44:03"
1815 1806 },
1816 1807 {
1817 1808 "name": "jms/translation-bundle",
... ... @@ -1820,12 +1811,12 @@
1820 1811 "source": {
1821 1812 "type": "git",
1822 1813 "url": "https://github.com/schmittjoh/JMSTranslationBundle.git",
1823   - "reference": "1c41baf3a0b8c6f0f3a3894c1adc0648ea651bc0"
  1814 + "reference": "8eff56746b73762dfe06414faf0fb609bfe51754"
1824 1815 },
1825 1816 "dist": {
1826 1817 "type": "zip",
1827   - "url": "https://api.github.com/repos/schmittjoh/JMSTranslationBundle/zipball/1c41baf3a0b8c6f0f3a3894c1adc0648ea651bc0",
1828   - "reference": "1c41baf3a0b8c6f0f3a3894c1adc0648ea651bc0",
  1818 + "url": "https://api.github.com/repos/schmittjoh/JMSTranslationBundle/zipball/8eff56746b73762dfe06414faf0fb609bfe51754",
  1819 + "reference": "8eff56746b73762dfe06414faf0fb609bfe51754",
1829 1820 "shasum": ""
1830 1821 },
1831 1822 "require": {
... ... @@ -1868,9 +1859,7 @@
1868 1859 "authors": [
1869 1860 {
1870 1861 "name": "Johannes M. Schmitt",
1871   - "email": "schmittjoh@gmail.com",
1872   - "homepage": "http://jmsyst.com",
1873   - "role": "Developer of wrapped JMSSerializerBundle"
  1862 + "email": "schmittjoh@gmail.com"
1874 1863 }
1875 1864 ],
1876 1865 "description": "Puts the Symfony2 Translation Component on steroids",
... ... @@ -1885,7 +1874,7 @@
1885 1874 "ui",
1886 1875 "webinterface"
1887 1876 ],
1888   - "time": "2014-02-17 15:05:26"
  1877 + "time": "2014-10-29 13:23:47"
1889 1878 },
1890 1879 {
1891 1880 "name": "jpgraph/jpgraph",
... ... @@ -1940,21 +1929,28 @@
1940 1929 },
1941 1930 {
1942 1931 "name": "knplabs/knp-components",
1943   - "version": "1.2.5",
  1932 + "version": "1.3.1",
1944 1933 "source": {
1945 1934 "type": "git",
1946 1935 "url": "https://github.com/KnpLabs/knp-components.git",
1947   - "reference": "8803fdaa18bd24bd158143e3d9099f4b243a31dd"
  1936 + "reference": "6d091c2f16eec2769db38f38e08c7bd5847ce072"
1948 1937 },
1949 1938 "dist": {
1950 1939 "type": "zip",
1951   - "url": "https://api.github.com/repos/KnpLabs/knp-components/zipball/8803fdaa18bd24bd158143e3d9099f4b243a31dd",
1952   - "reference": "8803fdaa18bd24bd158143e3d9099f4b243a31dd",
  1940 + "url": "https://api.github.com/repos/KnpLabs/knp-components/zipball/6d091c2f16eec2769db38f38e08c7bd5847ce072",
  1941 + "reference": "6d091c2f16eec2769db38f38e08c7bd5847ce072",
1953 1942 "shasum": ""
1954 1943 },
1955 1944 "require": {
1956 1945 "php": ">=5.3.2"
1957 1946 },
  1947 + "require-dev": {
  1948 + "doctrine/mongodb-odm": "~1.0@beta",
  1949 + "doctrine/orm": "~2.4",
  1950 + "phpunit/phpunit": "~4.2",
  1951 + "ruflin/elastica": "~1.0",
  1952 + "symfony/event-dispatcher": "~2.5"
  1953 + },
1958 1954 "suggest": {
1959 1955 "doctrine/common": "to allow usage pagination with Doctrine ArrayCollection",
1960 1956 "doctrine/mongodb-odm": "to allow usage pagination with Doctrine ODM MongoDB",
... ... @@ -1971,7 +1967,7 @@
1971 1967 },
1972 1968 "autoload": {
1973 1969 "psr-0": {
1974   - "Knp\\Component": "src/"
  1970 + "Knp\\Component": "src"
1975 1971 }
1976 1972 },
1977 1973 "notification-url": "https://packagist.org/downloads/",
... ... @@ -1997,20 +1993,20 @@
1997 1993 "pager",
1998 1994 "paginator"
1999 1995 ],
2000   - "time": "2014-01-09 16:23:31"
  1996 + "time": "2014-10-06 10:38:10"
2001 1997 },
2002 1998 {
2003 1999 "name": "knplabs/knp-menu",
2004   - "version": "v2.0.0-alpha1",
  2000 + "version": "v2.0.1",
2005 2001 "source": {
2006 2002 "type": "git",
2007 2003 "url": "https://github.com/KnpLabs/KnpMenu.git",
2008   - "reference": "323c0e6c3471208ab86e1cac561febd5c63cef52"
  2004 + "reference": "5758d0026d7ed00c8dd4727e413918cf2dc74c1a"
2009 2005 },
2010 2006 "dist": {
2011 2007 "type": "zip",
2012   - "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/323c0e6c3471208ab86e1cac561febd5c63cef52",
2013   - "reference": "323c0e6c3471208ab86e1cac561febd5c63cef52",
  2008 + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/5758d0026d7ed00c8dd4727e413918cf2dc74c1a",
  2009 + "reference": "5758d0026d7ed00c8dd4727e413918cf2dc74c1a",
2014 2010 "shasum": ""
2015 2011 },
2016 2012 "require": {
... ... @@ -2061,25 +2057,25 @@
2061 2057 "menu",
2062 2058 "tree"
2063 2059 ],
2064   - "time": "2013-06-23 19:58:17"
  2060 + "time": "2014-08-01 09:50:16"
2065 2061 },
2066 2062 {
2067 2063 "name": "knplabs/knp-menu-bundle",
2068   - "version": "v2.0.0-alpha1",
  2064 + "version": "v2.0.0",
2069 2065 "target-dir": "Knp/Bundle/MenuBundle",
2070 2066 "source": {
2071 2067 "type": "git",
2072 2068 "url": "https://github.com/KnpLabs/KnpMenuBundle.git",
2073   - "reference": "000b50881aff2831cdaadb8672e57e1b1502d643"
  2069 + "reference": "bdfc95da5ff7e4e67f948aaa9ea5da835a3a9088"
2074 2070 },
2075 2071 "dist": {
2076 2072 "type": "zip",
2077   - "url": "https://api.github.com/repos/KnpLabs/KnpMenuBundle/zipball/000b50881aff2831cdaadb8672e57e1b1502d643",
2078   - "reference": "000b50881aff2831cdaadb8672e57e1b1502d643",
  2073 + "url": "https://api.github.com/repos/KnpLabs/KnpMenuBundle/zipball/bdfc95da5ff7e4e67f948aaa9ea5da835a3a9088",
  2074 + "reference": "bdfc95da5ff7e4e67f948aaa9ea5da835a3a9088",
2079 2075 "shasum": ""
2080 2076 },
2081 2077 "require": {
2082   - "knplabs/knp-menu": "2.0.*",
  2078 + "knplabs/knp-menu": "~2.0",
2083 2079 "symfony/framework-bundle": "~2.0"
2084 2080 },
2085 2081 "type": "symfony-bundle",
... ... @@ -2103,7 +2099,7 @@
2103 2099 "email": "stof@notk.org"
2104 2100 },
2105 2101 {
2106   - "name": "KnpLabs",
  2102 + "name": "Knplabs",
2107 2103 "homepage": "http://knplabs.com"
2108 2104 },
2109 2105 {
... ... @@ -2115,7 +2111,7 @@
2115 2111 "keywords": [
2116 2112 "menu"
2117 2113 ],
2118   - "time": "2013-06-23 23:46:58"
  2114 + "time": "2014-08-01 09:57:23"
2119 2115 },
2120 2116 {
2121 2117 "name": "knplabs/knp-paginator-bundle",
... ... @@ -2124,12 +2120,12 @@
2124 2120 "source": {
2125 2121 "type": "git",
2126 2122 "url": "https://github.com/KnpLabs/KnpPaginatorBundle.git",
2127   - "reference": "d35547a771a03923d19d55ea335cd2801ad72dc2"
  2123 + "reference": "701dffe02dbe4aa8784d3d9e5343985318ef5e2c"
2128 2124 },
2129 2125 "dist": {
2130 2126 "type": "zip",
2131   - "url": "https://api.github.com/repos/KnpLabs/KnpPaginatorBundle/zipball/d35547a771a03923d19d55ea335cd2801ad72dc2",
2132   - "reference": "d35547a771a03923d19d55ea335cd2801ad72dc2",
  2127 + "url": "https://api.github.com/repos/KnpLabs/KnpPaginatorBundle/zipball/701dffe02dbe4aa8784d3d9e5343985318ef5e2c",
  2128 + "reference": "701dffe02dbe4aa8784d3d9e5343985318ef5e2c",
2133 2129 "shasum": ""
2134 2130 },
2135 2131 "require": {
... ... @@ -2174,7 +2170,7 @@
2174 2170 "pagination",
2175 2171 "paginator"
2176 2172 ],
2177   - "time": "2014-07-18 12:20:39"
  2173 + "time": "2014-09-15 15:49:24"
2178 2174 },
2179 2175 {
2180 2176 "name": "kriswallsmith/assetic",
... ... @@ -2295,12 +2291,12 @@
2295 2291 "source": {
2296 2292 "type": "git",
2297 2293 "url": "https://github.com/lightbase/cocar.git",
2298   - "reference": "720c610b5ca409c385902cadb68d8443f0fe9ae3"
  2294 + "reference": "0dddcc507ee9abb628b25b03d85a44c0ea9f39df"
2299 2295 },
2300 2296 "dist": {
2301 2297 "type": "zip",
2302   - "url": "https://api.github.com/repos/lightbase/cocar/zipball/720c610b5ca409c385902cadb68d8443f0fe9ae3",
2303   - "reference": "720c610b5ca409c385902cadb68d8443f0fe9ae3",
  2298 + "url": "https://api.github.com/repos/lightbase/cocar/zipball/0dddcc507ee9abb628b25b03d85a44c0ea9f39df",
  2299 + "reference": "0dddcc507ee9abb628b25b03d85a44c0ea9f39df",
2304 2300 "shasum": ""
2305 2301 },
2306 2302 "require": {
... ... @@ -2331,33 +2327,94 @@
2331 2327 "support": {
2332 2328 "source": "https://github.com/lightbase/cocar/tree/master"
2333 2329 },
2334   - "time": "2014-09-19 21:37:41"
  2330 + "time": "2014-10-21 17:54:58"
  2331 + },
  2332 + {
  2333 + "name": "liip/functional-test-bundle",
  2334 + "version": "1.0.2",
  2335 + "target-dir": "Liip/FunctionalTestBundle",
  2336 + "source": {
  2337 + "type": "git",
  2338 + "url": "https://github.com/liip/LiipFunctionalTestBundle.git",
  2339 + "reference": "e665bb4fca6ca449e225db569db671348a2579e4"
  2340 + },
  2341 + "dist": {
  2342 + "type": "zip",
  2343 + "url": "https://api.github.com/repos/liip/LiipFunctionalTestBundle/zipball/e665bb4fca6ca449e225db569db671348a2579e4",
  2344 + "reference": "e665bb4fca6ca449e225db569db671348a2579e4",
  2345 + "shasum": ""
  2346 + },
  2347 + "require": {
  2348 + "doctrine/common": "2.*",
  2349 + "php": ">=5.3.2",
  2350 + "symfony/browser-kit": "~2.0",
  2351 + "symfony/framework-bundle": "~2.0"
  2352 + },
  2353 + "suggest": {
  2354 + "doctrine/dbal": "Required when using the fixture loading functionality with an ORM and SQLite",
  2355 + "doctrine/doctrine-fixtures-bundle": "Required when using the fixture loading functionality",
  2356 + "doctrine/orm": "Required when using the fixture loading functionality with an ORM and SQLite"
  2357 + },
  2358 + "type": "symfony-bundle",
  2359 + "extra": {
  2360 + "branch-alias": {
  2361 + "dev-master": "1.0.x-dev"
  2362 + }
  2363 + },
  2364 + "autoload": {
  2365 + "psr-0": {
  2366 + "Liip\\FunctionalTestBundle": ""
  2367 + }
  2368 + },
  2369 + "notification-url": "https://packagist.org/downloads/",
  2370 + "license": [
  2371 + "MIT"
  2372 + ],
  2373 + "authors": [
  2374 + {
  2375 + "name": "Liip AG",
  2376 + "homepage": "http://www.liip.ch/"
  2377 + },
  2378 + {
  2379 + "name": "Community contributions",
  2380 + "homepage": "https://github.com/liip/LiipFunctionalTestBundle/contributors"
  2381 + }
  2382 + ],
  2383 + "description": "This bundles provides additional functional test-cases for Symfony2 applications",
  2384 + "keywords": [
  2385 + "Symfony2"
  2386 + ],
  2387 + "time": "2014-06-27 14:00:35"
2335 2388 },
2336 2389 {
2337 2390 "name": "monolog/monolog",
2338   - "version": "1.10.0",
  2391 + "version": "1.11.0",
2339 2392 "source": {
2340 2393 "type": "git",
2341 2394 "url": "https://github.com/Seldaek/monolog.git",
2342   - "reference": "25b16e801979098cb2f120e697bfce454b18bf23"
  2395 + "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa"
2343 2396 },
2344 2397 "dist": {
2345 2398 "type": "zip",
2346   - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/25b16e801979098cb2f120e697bfce454b18bf23",
2347   - "reference": "25b16e801979098cb2f120e697bfce454b18bf23",
  2399 + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
  2400 + "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
2348 2401 "shasum": ""
2349 2402 },
2350 2403 "require": {
2351 2404 "php": ">=5.3.0",
2352 2405 "psr/log": "~1.0"
2353 2406 },
  2407 + "provide": {
  2408 + "psr/log-implementation": "1.0.0"
  2409 + },
2354 2410 "require-dev": {
2355 2411 "aws/aws-sdk-php": "~2.4, >2.4.8",
2356 2412 "doctrine/couchdb": "~1.0@dev",
2357 2413 "graylog2/gelf-php": "~1.0",
2358 2414 "phpunit/phpunit": "~3.7.0",
2359 2415 "raven/raven": "~0.5",
2360   - "ruflin/elastica": "0.90.*"
  2416 + "ruflin/elastica": "0.90.*",
  2417 + "videlalvaro/php-amqplib": "~2.4"
2361 2418 },
2362 2419 "suggest": {
2363 2420 "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
... ... @@ -2367,12 +2424,13 @@
2367 2424 "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
2368 2425 "raven/raven": "Allow sending log messages to a Sentry server",
2369 2426 "rollbar/rollbar": "Allow sending log messages to Rollbar",
2370   - "ruflin/elastica": "Allow sending log messages to an Elastic Search server"
  2427 + "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
  2428 + "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
2371 2429 },
2372 2430 "type": "library",
2373 2431 "extra": {
2374 2432 "branch-alias": {
2375   - "dev-master": "1.10.x-dev"
  2433 + "dev-master": "1.11.x-dev"
2376 2434 }
2377 2435 },
2378 2436 "autoload": {
... ... @@ -2388,8 +2446,7 @@
2388 2446 {
2389 2447 "name": "Jordi Boggiano",
2390 2448 "email": "j.boggiano@seld.be",
2391   - "homepage": "http://seld.be",
2392   - "role": "Developer"
  2449 + "homepage": "http://seld.be"
2393 2450 }
2394 2451 ],
2395 2452 "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
... ... @@ -2399,7 +2456,7 @@
2399 2456 "logging",
2400 2457 "psr-3"
2401 2458 ],
2402   - "time": "2014-06-04 16:30:04"
  2459 + "time": "2014-09-30 13:30:58"
2403 2460 },
2404 2461 {
2405 2462 "name": "nikic/php-parser",
... ... @@ -2479,7 +2536,7 @@
2479 2536 ],
2480 2537 "authors": [
2481 2538 {
2482   - "name": "Johannes M. Schmitt",
  2539 + "name": "Johannes Schmitt",
2483 2540 "email": "schmittjoh@gmail.com",
2484 2541 "homepage": "https://github.com/schmittjoh",
2485 2542 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -2529,7 +2586,7 @@
2529 2586 ],
2530 2587 "authors": [
2531 2588 {
2532   - "name": "Johannes M. Schmitt",
  2589 + "name": "Johannes Schmitt",
2533 2590 "email": "schmittjoh@gmail.com",
2534 2591 "homepage": "https://github.com/schmittjoh",
2535 2592 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -2584,17 +2641,17 @@
2584 2641 },
2585 2642 {
2586 2643 "name": "sensio/distribution-bundle",
2587   - "version": "v2.3.4",
  2644 + "version": "v2.3.5",
2588 2645 "target-dir": "Sensio/Bundle/DistributionBundle",
2589 2646 "source": {
2590 2647 "type": "git",
2591 2648 "url": "https://github.com/sensiolabs/SensioDistributionBundle.git",
2592   - "reference": "66df91b4bd637a83299d8072aed3658bfd3b3021"
  2649 + "reference": "715fcb65f9a4841ffaf40c0bf050329d74c84cad"
2593 2650 },
2594 2651 "dist": {
2595 2652 "type": "zip",
2596   - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/66df91b4bd637a83299d8072aed3658bfd3b3021",
2597   - "reference": "66df91b4bd637a83299d8072aed3658bfd3b3021",
  2653 + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/715fcb65f9a4841ffaf40c0bf050329d74c84cad",
  2654 + "reference": "715fcb65f9a4841ffaf40c0bf050329d74c84cad",
2598 2655 "shasum": ""
2599 2656 },
2600 2657 "require": {
... ... @@ -2618,9 +2675,7 @@
2618 2675 "authors": [
2619 2676 {
2620 2677 "name": "Fabien Potencier",
2621   - "email": "fabien@symfony.com",
2622   - "homepage": "http://fabien.potencier.org",
2623   - "role": "Lead Developer"
  2678 + "email": "fabien@symfony.com"
2624 2679 }
2625 2680 ],
2626 2681 "description": "The base bundle for the Symfony Distributions",
... ... @@ -2628,7 +2683,7 @@
2628 2683 "configuration",
2629 2684 "distribution"
2630 2685 ],
2631   - "time": "2013-08-22 05:04:53"
  2686 + "time": "2014-09-03 12:25:05"
2632 2687 },
2633 2688 {
2634 2689 "name": "sensio/framework-extra-bundle",
... ... @@ -2681,17 +2736,17 @@
2681 2736 },
2682 2737 {
2683 2738 "name": "sensio/generator-bundle",
2684   - "version": "v2.3.5",
  2739 + "version": "v2.4.0",
2685 2740 "target-dir": "Sensio/Bundle/GeneratorBundle",
2686 2741 "source": {
2687 2742 "type": "git",
2688 2743 "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git",
2689   - "reference": "8b7a33aa3d22388443b6de0b0cf184122e9f60d2"
  2744 + "reference": "d5c0b996a46276d50943a80f95a46b59215a0e68"
2690 2745 },
2691 2746 "dist": {
2692 2747 "type": "zip",
2693   - "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/8b7a33aa3d22388443b6de0b0cf184122e9f60d2",
2694   - "reference": "8b7a33aa3d22388443b6de0b0cf184122e9f60d2",
  2748 + "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/d5c0b996a46276d50943a80f95a46b59215a0e68",
  2749 + "reference": "d5c0b996a46276d50943a80f95a46b59215a0e68",
2695 2750 "shasum": ""
2696 2751 },
2697 2752 "require": {
... ... @@ -2721,30 +2776,28 @@
2721 2776 "authors": [
2722 2777 {
2723 2778 "name": "Fabien Potencier",
2724   - "email": "fabien@symfony.com",
2725   - "homepage": "http://fabien.potencier.org",
2726   - "role": "Lead Developer"
  2779 + "email": "fabien@symfony.com"
2727 2780 }
2728 2781 ],
2729 2782 "description": "This bundle generates code for you",
2730   - "time": "2014-04-28 14:01:06"
  2783 + "time": "2014-09-22 14:56:14"
2731 2784 },
2732 2785 {
2733 2786 "name": "swiftmailer/swiftmailer",
2734   - "version": "v5.2.1",
  2787 + "version": "v5.3.0",
2735 2788 "source": {
2736 2789 "type": "git",
2737 2790 "url": "https://github.com/swiftmailer/swiftmailer.git",
2738   - "reference": "2b9af56cc676c338d52fca4c657e5bdff73bb7af"
  2791 + "reference": "b86b927dfefdb56ab0b22d1350033d9a38e9f205"
2739 2792 },
2740 2793 "dist": {
2741 2794 "type": "zip",
2742   - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/2b9af56cc676c338d52fca4c657e5bdff73bb7af",
2743   - "reference": "2b9af56cc676c338d52fca4c657e5bdff73bb7af",
  2795 + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/b86b927dfefdb56ab0b22d1350033d9a38e9f205",
  2796 + "reference": "b86b927dfefdb56ab0b22d1350033d9a38e9f205",
2744 2797 "shasum": ""
2745 2798 },
2746 2799 "require": {
2747   - "php": ">=5.2.4"
  2800 + "php": ">=5.3.3"
2748 2801 },
2749 2802 "require-dev": {
2750 2803 "mockery/mockery": "~0.9.1"
... ... @@ -2752,7 +2805,7 @@
2752 2805 "type": "library",
2753 2806 "extra": {
2754 2807 "branch-alias": {
2755   - "dev-master": "5.2-dev"
  2808 + "dev-master": "5.3-dev"
2756 2809 }
2757 2810 },
2758 2811 "autoload": {
... ... @@ -2766,13 +2819,11 @@
2766 2819 ],
2767 2820 "authors": [
2768 2821 {
2769   - "name": "Fabien Potencier",
2770   - "email": "fabien@symfony.com",
2771   - "homepage": "http://fabien.potencier.org",
2772   - "role": "Lead Developer"
  2822 + "name": "Chris Corbyn"
2773 2823 },
2774 2824 {
2775   - "name": "Chris Corbyn"
  2825 + "name": "Fabien Potencier",
  2826 + "email": "fabien@symfony.com"
2776 2827 }
2777 2828 ],
2778 2829 "description": "Swiftmailer, free feature-rich PHP mailer",
... ... @@ -2781,7 +2832,7 @@
2781 2832 "mail",
2782 2833 "mailer"
2783 2834 ],
2784   - "time": "2014-06-13 11:44:54"
  2835 + "time": "2014-10-04 05:53:18"
2785 2836 },
2786 2837 {
2787 2838 "name": "symfony/assetic-bundle",
... ... @@ -2847,75 +2898,23 @@
2847 2898 "time": "2013-05-16 05:32:23"
2848 2899 },
2849 2900 {
2850   - "name": "symfony/class-loader",
2851   - "version": "v2.2.11",
2852   - "target-dir": "Symfony/Component/ClassLoader",
2853   - "source": {
2854   - "type": "git",
2855   - "url": "https://github.com/symfony/ClassLoader.git",
2856   - "reference": "0a5217edb631fe3d0e549133381cc5875c8d0e16"
2857   - },
2858   - "dist": {
2859   - "type": "zip",
2860   - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/0a5217edb631fe3d0e549133381cc5875c8d0e16",
2861   - "reference": "0a5217edb631fe3d0e549133381cc5875c8d0e16",
2862   - "shasum": ""
2863   - },
2864   - "require": {
2865   - "php": ">=5.3.3"
2866   - },
2867   - "require-dev": {
2868   - "symfony/finder": "~2.0"
2869   - },
2870   - "type": "library",
2871   - "extra": {
2872   - "branch-alias": {
2873   - "dev-master": "2.2-dev"
2874   - }
2875   - },
2876   - "autoload": {
2877   - "psr-0": {
2878   - "Symfony\\Component\\ClassLoader\\": ""
2879   - }
2880   - },
2881   - "notification-url": "https://packagist.org/downloads/",
2882   - "license": [
2883   - "MIT"
2884   - ],
2885   - "authors": [
2886   - {
2887   - "name": "Fabien Potencier",
2888   - "email": "fabien@symfony.com",
2889   - "homepage": "http://fabien.potencier.org",
2890   - "role": "Lead Developer"
2891   - },
2892   - {
2893   - "name": "Symfony Community",
2894   - "homepage": "http://symfony.com/contributors"
2895   - }
2896   - ],
2897   - "description": "Symfony ClassLoader Component",
2898   - "homepage": "http://symfony.com",
2899   - "time": "2013-11-25 08:44:14"
2900   - },
2901   - {
2902 2901 "name": "symfony/icu",
2903   - "version": "v1.2.2",
  2902 + "version": "v1.1.2",
2904 2903 "target-dir": "Symfony/Component/Icu",
2905 2904 "source": {
2906 2905 "type": "git",
2907 2906 "url": "https://github.com/symfony/Icu.git",
2908   - "reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a"
  2907 + "reference": "229730a14ccac63bb3c5d9f0494fcd27140c0dd3"
2909 2908 },
2910 2909 "dist": {
2911 2910 "type": "zip",
2912   - "url": "https://api.github.com/repos/symfony/Icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
2913   - "reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
  2911 + "url": "https://api.github.com/repos/symfony/Icu/zipball/229730a14ccac63bb3c5d9f0494fcd27140c0dd3",
  2912 + "reference": "229730a14ccac63bb3c5d9f0494fcd27140c0dd3",
2914 2913 "shasum": ""
2915 2914 },
2916 2915 "require": {
2917 2916 "ext-intl": "*",
2918   - "lib-icu": ">=4.4",
  2917 + "lib-icu": ">=3.8",
2919 2918 "php": ">=5.3.3",
2920 2919 "symfony/intl": "~2.3"
2921 2920 },
... ... @@ -2945,42 +2944,43 @@
2945 2944 "icu",
2946 2945 "intl"
2947 2946 ],
2948   - "time": "2014-07-25 09:58:17"
  2947 + "time": "2014-07-25 10:00:11"
2949 2948 },
2950 2949 {
2951 2950 "name": "symfony/monolog-bundle",
2952   - "version": "v2.3.0",
2953   - "target-dir": "Symfony/Bundle/MonologBundle",
  2951 + "version": "v2.6.1",
2954 2952 "source": {
2955 2953 "type": "git",
2956 2954 "url": "https://github.com/symfony/MonologBundle.git",
2957   - "reference": "03ed73bc11367b3156cc21f22ac37c7f70fcd10a"
  2955 + "reference": "227bbeefe30f2d95e3fe5fbd1ccda414287a957a"
2958 2956 },
2959 2957 "dist": {
2960 2958 "type": "zip",
2961   - "url": "https://api.github.com/repos/symfony/MonologBundle/zipball/03ed73bc11367b3156cc21f22ac37c7f70fcd10a",
2962   - "reference": "03ed73bc11367b3156cc21f22ac37c7f70fcd10a",
  2959 + "url": "https://api.github.com/repos/symfony/MonologBundle/zipball/227bbeefe30f2d95e3fe5fbd1ccda414287a957a",
  2960 + "reference": "227bbeefe30f2d95e3fe5fbd1ccda414287a957a",
2963 2961 "shasum": ""
2964 2962 },
2965 2963 "require": {
2966   - "monolog/monolog": "~1.3",
  2964 + "monolog/monolog": "~1.8",
2967 2965 "php": ">=5.3.2",
2968   - "symfony/config": "~2.2-beta2",
2969   - "symfony/dependency-injection": "~2.2-beta2",
2970   - "symfony/monolog-bridge": "~2.2-beta2"
  2966 + "symfony/config": "~2.3",
  2967 + "symfony/dependency-injection": "~2.3",
  2968 + "symfony/http-kernel": "~2.3",
  2969 + "symfony/monolog-bridge": "~2.3"
2971 2970 },
2972 2971 "require-dev": {
2973   - "symfony/yaml": "~2.2-beta2"
  2972 + "symfony/console": "~2.3",
  2973 + "symfony/yaml": "~2.3"
2974 2974 },
2975 2975 "type": "symfony-bundle",
2976 2976 "extra": {
2977 2977 "branch-alias": {
2978   - "dev-master": "2.2.x-dev"
  2978 + "dev-master": "2.6.x-dev"
2979 2979 }
2980 2980 },
2981 2981 "autoload": {
2982   - "psr-0": {
2983   - "Symfony\\Bundle\\MonologBundle": ""
  2982 + "psr-4": {
  2983 + "Symfony\\Bundle\\MonologBundle\\": ""
2984 2984 }
2985 2985 },
2986 2986 "notification-url": "https://packagist.org/downloads/",
... ... @@ -2989,14 +2989,12 @@
2989 2989 ],
2990 2990 "authors": [
2991 2991 {
2992   - "name": "Fabien Potencier",
2993   - "email": "fabien@symfony.com",
2994   - "homepage": "http://fabien.potencier.org",
2995   - "role": "Lead Developer"
2996   - },
2997   - {
2998 2992 "name": "Symfony Community",
2999 2993 "homepage": "http://symfony.com/contributors"
  2994 + },
  2995 + {
  2996 + "name": "Fabien Potencier",
  2997 + "email": "fabien@symfony.com"
3000 2998 }
3001 2999 ],
3002 3000 "description": "Symfony MonologBundle",
... ... @@ -3005,7 +3003,7 @@
3005 3003 "log",
3006 3004 "logging"
3007 3005 ],
3008   - "time": "2013-05-27 18:06:55"
  3006 + "time": "2014-07-21 00:36:06"
3009 3007 },
3010 3008 {
3011 3009 "name": "symfony/swiftmailer-bundle",
... ... @@ -3066,16 +3064,16 @@
3066 3064 },
3067 3065 {
3068 3066 "name": "symfony/symfony",
3069   - "version": "v2.3.10",
  3067 + "version": "v2.5.4",
3070 3068 "source": {
3071 3069 "type": "git",
3072 3070 "url": "https://github.com/symfony/symfony.git",
3073   - "reference": "e4b9ff28b7c357971947ed12f99fbc68ff116830"
  3071 + "reference": "3a369dddea56596df91977d8c2083e70784852f2"
3074 3072 },
3075 3073 "dist": {
3076 3074 "type": "zip",
3077   - "url": "https://api.github.com/repos/symfony/symfony/zipball/e4b9ff28b7c357971947ed12f99fbc68ff116830",
3078   - "reference": "e4b9ff28b7c357971947ed12f99fbc68ff116830",
  3075 + "url": "https://api.github.com/repos/symfony/symfony/zipball/3a369dddea56596df91977d8c2083e70784852f2",
  3076 + "reference": "3a369dddea56596df91977d8c2083e70784852f2",
3079 3077 "shasum": ""
3080 3078 },
3081 3079 "require": {
... ... @@ -3083,7 +3081,7 @@
3083 3081 "php": ">=5.3.3",
3084 3082 "psr/log": "~1.0",
3085 3083 "symfony/icu": "~1.0",
3086   - "twig/twig": "~1.11"
  3084 + "twig/twig": "~1.12"
3087 3085 },
3088 3086 "replace": {
3089 3087 "symfony/browser-kit": "self.version",
... ... @@ -3096,6 +3094,7 @@
3096 3094 "symfony/doctrine-bridge": "self.version",
3097 3095 "symfony/dom-crawler": "self.version",
3098 3096 "symfony/event-dispatcher": "self.version",
  3097 + "symfony/expression-language": "self.version",
3099 3098 "symfony/filesystem": "self.version",
3100 3099 "symfony/finder": "self.version",
3101 3100 "symfony/form": "self.version",
... ... @@ -3112,7 +3111,11 @@
3112 3111 "symfony/proxy-manager-bridge": "self.version",
3113 3112 "symfony/routing": "self.version",
3114 3113 "symfony/security": "self.version",
  3114 + "symfony/security-acl": "self.version",
3115 3115 "symfony/security-bundle": "self.version",
  3116 + "symfony/security-core": "self.version",
  3117 + "symfony/security-csrf": "self.version",
  3118 + "symfony/security-http": "self.version",
3116 3119 "symfony/serializer": "self.version",
3117 3120 "symfony/stopwatch": "self.version",
3118 3121 "symfony/swiftmailer-bridge": "self.version",
... ... @@ -3128,15 +3131,16 @@
3128 3131 "doctrine/data-fixtures": "1.0.*",
3129 3132 "doctrine/dbal": "~2.2",
3130 3133 "doctrine/orm": "~2.2,>=2.2.3",
  3134 + "egulias/email-validator": "~1.2",
3131 3135 "ircmaxell/password-compat": "1.0.*",
3132 3136 "monolog/monolog": "~1.3",
3133   - "ocramius/proxy-manager": ">=0.3.1,<0.4-dev",
  3137 + "ocramius/proxy-manager": ">=0.3.1,<0.6-dev",
3134 3138 "propel/propel1": "1.6.*"
3135 3139 },
3136 3140 "type": "library",
3137 3141 "extra": {
3138 3142 "branch-alias": {
3139   - "dev-master": "2.3-dev"
  3143 + "dev-master": "2.5-dev"
3140 3144 }
3141 3145 },
3142 3146 "autoload": {
... ... @@ -3157,14 +3161,12 @@
3157 3161 ],
3158 3162 "authors": [
3159 3163 {
3160   - "name": "Fabien Potencier",
3161   - "email": "fabien@symfony.com",
3162   - "homepage": "http://fabien.potencier.org",
3163   - "role": "Lead Developer"
3164   - },
3165   - {
3166 3164 "name": "Symfony Community",
3167 3165 "homepage": "http://symfony.com/contributors"
  3166 + },
  3167 + {
  3168 + "name": "Fabien Potencier",
  3169 + "email": "fabien@symfony.com"
3168 3170 }
3169 3171 ],
3170 3172 "description": "The Symfony PHP framework",
... ... @@ -3172,7 +3174,7 @@
3172 3174 "keywords": [
3173 3175 "framework"
3174 3176 ],
3175   - "time": "2014-02-12 08:18:23"
  3177 + "time": "2014-09-03 09:51:48"
3176 3178 },
3177 3179 {
3178 3180 "name": "twbs/bootstrap",
... ... @@ -3218,25 +3220,25 @@
3218 3220 },
3219 3221 {
3220 3222 "name": "twig/extensions",
3221   - "version": "v1.0.1",
  3223 + "version": "v1.1.0",
3222 3224 "source": {
3223 3225 "type": "git",
3224 3226 "url": "https://github.com/fabpot/Twig-extensions.git",
3225   - "reference": "f91a82ec225e5bb108e01a0f93c9be04f84dcfa0"
  3227 + "reference": "c0ab818595338dd5569369bfce2552d02cec5d50"
3226 3228 },
3227 3229 "dist": {
3228 3230 "type": "zip",
3229   - "url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/f91a82ec225e5bb108e01a0f93c9be04f84dcfa0",
3230   - "reference": "f91a82ec225e5bb108e01a0f93c9be04f84dcfa0",
  3231 + "url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/c0ab818595338dd5569369bfce2552d02cec5d50",
  3232 + "reference": "c0ab818595338dd5569369bfce2552d02cec5d50",
3231 3233 "shasum": ""
3232 3234 },
3233 3235 "require": {
3234   - "twig/twig": "~1.0"
  3236 + "twig/twig": "~1.12"
3235 3237 },
3236 3238 "type": "library",
3237 3239 "extra": {
3238 3240 "branch-alias": {
3239   - "dev-master": "1.0.x-dev"
  3241 + "dev-master": "1.1.x-dev"
3240 3242 }
3241 3243 },
3242 3244 "autoload": {
... ... @@ -3259,24 +3261,23 @@
3259 3261 "description": "Common additional features for Twig that do not directly belong in core",
3260 3262 "homepage": "https://github.com/fabpot/Twig-extensions",
3261 3263 "keywords": [
3262   - "debug",
3263 3264 "i18n",
3264 3265 "text"
3265 3266 ],
3266   - "time": "2013-10-18 19:37:15"
  3267 + "time": "2014-07-05 10:01:35"
3267 3268 },
3268 3269 {
3269 3270 "name": "twig/twig",
3270   - "version": "v1.16.0",
  3271 + "version": "v1.16.2",
3271 3272 "source": {
3272 3273 "type": "git",
3273 3274 "url": "https://github.com/fabpot/Twig.git",
3274   - "reference": "8ce37115802e257a984a82d38254884085060024"
  3275 + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc"
3275 3276 },
3276 3277 "dist": {
3277 3278 "type": "zip",
3278   - "url": "https://api.github.com/repos/fabpot/Twig/zipball/8ce37115802e257a984a82d38254884085060024",
3279   - "reference": "8ce37115802e257a984a82d38254884085060024",
  3279 + "url": "https://api.github.com/repos/fabpot/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc",
  3280 + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc",
3280 3281 "shasum": ""
3281 3282 },
3282 3283 "require": {
... ... @@ -3305,7 +3306,7 @@
3305 3306 "role": "Lead Developer"
3306 3307 },
3307 3308 {
3308   - "name": "Armin Ronacher2",
  3309 + "name": "Armin Ronacher",
3309 3310 "email": "armin.ronacher@active-4.com",
3310 3311 "role": "Project Founder"
3311 3312 },
... ... @@ -3320,7 +3321,7 @@
3320 3321 "keywords": [
3321 3322 "templating"
3322 3323 ],
3323   - "time": "2014-07-05 12:19:05"
  3324 + "time": "2014-10-17 12:53:44"
3324 3325 },
3325 3326 {
3326 3327 "name": "willdurand/jsonp-callback-validator",
... ... @@ -3364,16 +3365,16 @@
3364 3365 },
3365 3366 {
3366 3367 "name": "willdurand/negotiation",
3367   - "version": "1.3.3",
  3368 + "version": "1.3.4",
3368 3369 "source": {
3369 3370 "type": "git",
3370 3371 "url": "https://github.com/willdurand/Negotiation.git",
3371   - "reference": "a98fb6b9808610c1aa326c736893d3d77d9383b6"
  3372 + "reference": "d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c"
3372 3373 },
3373 3374 "dist": {
3374 3375 "type": "zip",
3375   - "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/a98fb6b9808610c1aa326c736893d3d77d9383b6",
3376   - "reference": "a98fb6b9808610c1aa326c736893d3d77d9383b6",
  3376 + "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c",
  3377 + "reference": "d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c",
3377 3378 "shasum": ""
3378 3379 },
3379 3380 "require": {
... ... @@ -3397,8 +3398,7 @@
3397 3398 "authors": [
3398 3399 {
3399 3400 "name": "William Durand",
3400   - "email": "william.durand1@gmail.com",
3401   - "homepage": "http://www.willdurand.fr"
  3401 + "email": "william.durand1@gmail.com"
3402 3402 }
3403 3403 ],
3404 3404 "description": "Content Negotiation tools for PHP provided as a standalone library.",
... ... @@ -3410,7 +3410,7 @@
3410 3410 "header",
3411 3411 "negotiation"
3412 3412 ],
3413   - "time": "2014-05-16 12:34:51"
  3413 + "time": "2014-10-02 07:26:00"
3414 3414 }
3415 3415 ],
3416 3416 "packages-dev": [
... ... @@ -3425,8 +3425,6 @@
3425 3425 "doctrine/data-fixtures": 20,
3426 3426 "doctrine/doctrine-fixtures-bundle": 20,
3427 3427 "jms/translation-bundle": 20,
3428   - "knplabs/knp-menu": 15,
3429   - "knplabs/knp-menu-bundle": 15,
3430 3428 "jpgraph/jpgraph": 20,
3431 3429 "friendsofsymfony/rest-bundle": 20,
3432 3430 "jms/serializer": 20,
... ...
composer.phar
No preview for this file type
src/Cacic/CommonBundle/Controller/AgenteController.php 0 → 100644
... ... @@ -0,0 +1,352 @@
  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 + $saida = array();
  62 + $base_url = $request->getBaseUrl();
  63 + $base_url = preg_replace('/\/app.*.php/', "/", $base_url);
  64 +
  65 + // Primeiro tratamos agentes Linux
  66 + // A regra é que o agente mais atual estará na pasta current
  67 + $finder->directories()->in($linuxDir);
  68 + $saida['linux']['versions'] = array();
  69 + foreach($finder as $version) {
  70 + $agentes = new Finder();
  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($linuxDir."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 + $agentes = new Finder();
  96 + if ($version->getFileName() == 'current') {
  97 + continue;
  98 + }
  99 + $saida['windows']['versions'][$version->getFileName()] = array();
  100 + $agentes->files()->in($version->getRealPath());
  101 + //$logger->debug("1111111111111111111111111111111111111111111 ".$version->getRealPath());
  102 + foreach ($agentes as $file) {
  103 + //$logger->debug("77777777777777777777777777777777777777777 $file");
  104 + array_push($saida['windows']['versions'][$version->getFileName()], array(
  105 + 'name' => $file->getFileName(),
  106 + 'download_url' => $base_url . 'downloads/cacic/windows/' . $version->getFileName() . '/' . $file->getFileName(),
  107 + 'hash' => md5_file($file->getRealPath()),
  108 + 'size' => $file->getSize(),
  109 + 'filename' => 'cacic/windows/' . $version->getFileName() . '/' . $file->getFileName()
  110 + ));
  111 +
  112 + }
  113 + }
  114 + // Get latest version
  115 + $current = @basename(@readlink($windowsDir."current"));
  116 + $saida['windows']['live_version'] = $current;
  117 +
  118 + $logger->debug("4444444444444444444444444444444444 ".print_r($saida, true));
  119 +
  120 + if ( $request->isMethod('POST') )
  121 + {
  122 + // Aqui vamos fazer o tratamento dos agentes
  123 + $data = $form->getData();
  124 + $data['windows_version'] = $request->get('agentes')['windows_version'];
  125 + $data['linux_version'] = $request->get('agentes')['linux_version'];
  126 + $files = $request->files->get('agentes');
  127 +
  128 + //$logger->debug("99999999999999999999999999999999999 ".print_r($data, true));
  129 + if (!empty($files['windows'])) {
  130 + //$logger->debug("88888888888888888888888888888888888888 ".print_r($files['windows'], true));
  131 + if (empty($data['windows_version'])) {
  132 + $logger->error("O parâmetro versão é obrigatório");
  133 + $this->get('session')->getFlashBag()->add('error', 'O parâmetro versão é obrigatório');
  134 + } else {
  135 + $versionDir = $windowsDir . $data['windows_version'];
  136 + $result = $this->uploadPackage($files['windows'], $versionDir);
  137 + if (!$result) {
  138 + $logger->error("Erro na atualização dos Agentes Windows");
  139 + $this->get('session')->getFlashBag()->add('error', 'Erro na atualização dos agentes Windows');
  140 + } else {
  141 + // Make this version current
  142 + $logger->debug("Agentes atualizados com sucesso. Ajustando para versão $versionDir");
  143 + @unlink("$windowsDir"."current");
  144 + symlink($versionDir, "$windowsDir"."current");
  145 + $this->get('session')->getFlashBag()->add('success', 'Agentes atualizados com sucesso!');
  146 + }
  147 + }
  148 + }
  149 +
  150 + if (!empty($files['linux'])) {
  151 + if (empty($data['linux_version'])) {
  152 + $logger->error("O parâmetro versão é obrigatório");
  153 + $this->get('session')->getFlashBag()->add('error', 'O parâmetro versão é obrigatório');
  154 + } else {
  155 + $versionDir = $linuxDir . $data['linux_version'];
  156 + $result = $this->uploadPackage($files['linux'], $versionDir);
  157 + if (!$result) {
  158 + $logger->error("Erro na atualização dos Agentes Linux");
  159 + $this->get('session')->getFlashBag()->add('error', 'Erro na atualização dos agentes Linux');
  160 + } else {
  161 + // Make this version current
  162 + $logger->debug("Agentes atualizados com sucesso. Ajustando para versão $versionDir");
  163 + @unlink("$linuxDir"."current");
  164 + symlink($versionDir, $linuxDir."current");
  165 + $this->get('session')->getFlashBag()->add('success', 'Agentes atualizados com sucesso!');
  166 + }
  167 + }
  168 + }
  169 +
  170 + }
  171 +
  172 + return $this->render( 'CacicCommonBundle:Agente:index.html.twig',
  173 + array(
  174 + 'local'=>$locale,
  175 + 'saida' => $saida,
  176 + 'form' => $form->createView()
  177 + )
  178 + );
  179 + }
  180 +
  181 + public function uploadPackage($file, $version) {
  182 + $logger = $this->get('logger');
  183 + if (!$file->isValid()) {
  184 + $logger->error("Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage());
  185 + $this->get('session')->getFlashBag()->add('error', "Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage());
  186 + return false;
  187 + }
  188 + $result = false;
  189 + mkdir($version);
  190 + //$logger->debug("66666666666666666666666666666666666 ".print_r($file, true));
  191 +
  192 + $extension = $file->getClientOriginalExtension();
  193 + //$logger->debug("00000000000000000000000000000000000000000 $extension | $version");
  194 +
  195 + if ($extension == 'zip') {
  196 + $zip = new ZipArchive;
  197 + if ($zip->open($file) === TRUE) {
  198 + $zip->extractTo($version);
  199 + $zip->close();
  200 + $logger->debug("Arquivo .zip descompactado com sucesso ". $file->getClientOriginalName());
  201 + $result = true;
  202 + } else {
  203 + $logger->error("Erro na descompactação do arquivo .zip ". $file->getClientOriginalName());
  204 + $this->get('session')->getFlashBag()->add('error', "Erro na descompatcação do arquivo .zip\n".$file->getErrorMessage());
  205 + $result = false;
  206 + }
  207 +
  208 + } elseif ($extension == 'tar.gz') {
  209 + try {
  210 + // decompress from gz
  211 + $tar = $version.$file->getClientOriginalName();
  212 + $p = new PharData($tar, 0, $file);
  213 + $p->decompress();
  214 +
  215 + // Now unarchive from tar
  216 + $phar = new PharData($tar);
  217 + $phar->extractTo($version);
  218 +
  219 + // Remove file
  220 + unlink($tar);
  221 +
  222 + $result = true;
  223 + } catch (Exception $e) {
  224 + $logger->error("Erro na extração do arquivo .gz \n".$e->getMessage());
  225 + $this->get('session')->getFlashBag()->add('error', "Erro na extração do arquivo .gz\n".$file->getErrorMessage());
  226 + $result = false;
  227 + }
  228 +
  229 + } else {
  230 + $logger->error("Extensão inválida para upload dos agentes ".$extension);
  231 + $this->get('session')->getFlashBag()->add('error', "Extensão inválida para upload dos agentes ".$extension);
  232 + $result = false;
  233 + }
  234 +
  235 + return $result;
  236 + }
  237 +
  238 + public function excluirAction(Request $request) {
  239 + if ( ! $request->isXmlHttpRequest() )
  240 + throw $this->createNotFoundException( 'Página não encontrada' );
  241 +
  242 +
  243 +
  244 + $rootDir = $this->container->get('kernel')->getRootDir();
  245 + $webDir = $rootDir . "/../web/";
  246 + $downloadsDir = $webDir . "downloads/";
  247 + $filepath = $downloadsDir . $request->get('id');
  248 +
  249 + $this->get('logger')->debug("Excluindo arquivo de agente ".$filepath);
  250 +
  251 + $result = unlink($filepath);
  252 +
  253 + if ($result) {
  254 + $response = new Response( json_encode( array('status' => 'ok') ) );
  255 + $response->headers->set('Content-Type', 'application/json');
  256 + } else {
  257 + $response = new Response( json_encode( array('status' => 'error') ) );
  258 + $response->headers->set('Content-Type', 'application/json');
  259 + }
  260 +
  261 + return $response;
  262 + }
  263 +
  264 + public function deployAction(Request $request) {
  265 + $logger = $this->get('logger');
  266 + // Cria diretório dos agentes se não existir
  267 + $rootDir = $this->container->get('kernel')->getRootDir();
  268 + $webDir = $rootDir . "/../web/";
  269 + $downloadsDir = $webDir . "downloads/";
  270 + if (!is_dir($downloadsDir)) {
  271 + mkdir($downloadsDir);
  272 + }
  273 +
  274 + $outrosDir = $downloadsDir . "outros/";
  275 + if (!is_dir($outrosDir)) {
  276 + mkdir($outrosDir);
  277 + }
  278 +
  279 +
  280 + $form = $this->createForm( new DeployType() );
  281 + $locale = $request->getLocale();
  282 +
  283 + // Constrói array de arquivos e hashes
  284 + $finder = new Finder();
  285 + $agentes = new Finder();
  286 + $saida = array();
  287 + $base_url = $request->getBaseUrl();
  288 + $base_url = preg_replace('/\/app.*.php/', "/", $base_url);
  289 +
  290 + // Tratamos upload de módulos genéricos
  291 + $finder->files()->in($outrosDir);
  292 + $saida['outros'] = array();
  293 + foreach($finder as $file) {
  294 + array_push($saida['outros'], array(
  295 + 'name' => $file->getFileName(),
  296 + 'download_url' => $base_url . 'downloads/outros/' . $file->getFileName(),
  297 + 'hash' => md5_file($file->getRealPath()),
  298 + 'size' => $file->getSize(),
  299 + 'filename' => "outros/" . $file->getFileName()
  300 + ));
  301 +
  302 + }
  303 +
  304 + if ( $request->isMethod('POST') )
  305 + {
  306 + // Aqui vamos fazer o tratamento dos agentes
  307 + $files = $request->files->get('deploy');
  308 +
  309 + //$logger->debug("99999999999999999999999999999999999 ".print_r($files, true));
  310 + if (!empty($files['outros'])) {
  311 + //$logger->debug("88888888888888888888888888888888888888 ".print_r($files['outros'], true));
  312 + $result = $this->uploadFile($files['outros'], $outrosDir);
  313 + if (!$result) {
  314 + $logger->error("Erro no upload do módulo");
  315 + $this->get('session')->getFlashBag()->add('error', 'Erro no upload do módulo');
  316 + } else {
  317 + // Make this version current
  318 + $logger->debug("Upload do módulo realizado com sucesso");
  319 + $this->get('session')->getFlashBag()->add('success', 'Upload do módulo realizado com sucesso!');
  320 + }
  321 + }
  322 +
  323 + }
  324 +
  325 + $logger->debug("3333333333333333333333333333333333333333 ".print_r($saida, true));
  326 +
  327 + return $this->render( 'CacicCommonBundle:Agente:deploy.html.twig',
  328 + array(
  329 + 'local'=>$locale,
  330 + 'saida' => $saida,
  331 + 'form' => $form->createView()
  332 + )
  333 + );
  334 + }
  335 +
  336 + public function uploadFile($file, $version) {
  337 + $logger = $this->get('logger');
  338 + if (!$file->isValid()) {
  339 + $logger->error("Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage());
  340 + $this->get('session')->getFlashBag()->add('error', "Erro no upload do arquivo. Arquivo inválido\n".$file->getErrorMessage());
  341 + return false;
  342 + }
  343 +
  344 + mkdir($version);
  345 + $file->move($version, $file->getClientOriginalName());
  346 + $result = true;
  347 + $logger->debug("Upload do módulo realizado com sucesso");
  348 +
  349 + return $result;
  350 + }
  351 +
  352 +}
... ...
src/Cacic/CommonBundle/Controller/RedeController.php
... ... @@ -13,6 +13,7 @@ use Cacic\WSBundle\Helper;
13 13 use Cacic\CommonBundle\Helper as CacicHelper;
14 14 use Ijanki\Bundle\FtpBundle\Exception\FtpException;
15 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 491 $em->persist($redeVersaoModulo);
491 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 498 //echo $_GET['pIntIdRede'] . '_=_' . $_GET['pStrNmItem'] . '_=_' . $strResult;
... ... @@ -540,7 +543,7 @@ class RedeController extends Controller
540 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 547 // Retorno esperado....: 230 => FTP_USER_LOGGED_IN
545 548 // Retorno NÃO esperado: 530 => FTP_USER_NOT_LOGGED_IN
546 549  
... ... @@ -669,4 +672,329 @@ class RedeController extends Controller
669 672 )
670 673 );
671 674 }
672   -}
673 675 \ No newline at end of file
  676 +
  677 + /**
  678 + * Função nova para atualização das subredes
  679 + *
  680 + * @param Request $request
  681 + * @return Response
  682 + */
  683 + public function manutencaoNeoAction(Request $request)
  684 + {
  685 + $logger = $this->get('logger');
  686 +
  687 + // Primeiro carrega lista dos módulos
  688 + $modulos = $this->modulosNeoArray($request);
  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 + $saida = array();
  842 + $base_url = $request->getBaseUrl();
  843 + $base_url = preg_replace('/\/app.*.php/', "/", $base_url);
  844 +
  845 + // Primeiro tratamos agentes Linux
  846 + // A regra é que o agente mais atual estará na pasta current
  847 + $current = basename(readlink($linuxDir."current"));
  848 + $finder = new Finder();
  849 + $finder->directories()->in($linuxDir);
  850 + foreach($finder as $version) {
  851 + $agentes = new Finder();
  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 = new Finder();
  883 + $finder->directories()->in($windowsDir);
  884 + $current = basename(readlink($windowsDir."current"));
  885 + foreach($finder as $version) {
  886 + $agentes = new Finder();
  887 + if ($version->getFileName() == 'current') {
  888 + // Aqui considera somente a última versão
  889 + $agentes->files()->in($version->getRealPath());
  890 + foreach ($agentes as $file) {
  891 + if (!empty($nmModulos)) {
  892 + // Filtra por nome de módulo
  893 + if (!in_array($file->getFileName(), $nmModulos)) {
  894 + continue;
  895 + }
  896 + }
  897 + $saida[$file->getFileName()] = array(
  898 + 'name' => $file->getFileName(),
  899 + 'versao' => $current,
  900 + 'download_url' => $base_url . 'downloads/cacic/windows/' . $version->getFileName() . '/' . $file->getFileName(),
  901 + 'hash' => md5_file($file->getRealPath()),
  902 + 'size' => $file->getSize(),
  903 + 'filename' => 'cacic/windows/' . $version->getFileName() . '/' . $file->getFileName(),
  904 + 'tipoSo' => 'windows'
  905 + );
  906 + }
  907 + } else {
  908 + continue;
  909 + }
  910 +
  911 + }
  912 + // Get latest version
  913 + //$current = basename(readlink($windowsDir."current"));
  914 + //$saida['windows']['live_version'] = $current;
  915 +
  916 + // Retorna o array com todos os resultados
  917 + return $saida;
  918 + }
  919 +
  920 + public function updateSubredesNeo(Request $request, $rede, $modulos = null)
  921 + {
  922 + $logger = $this->get('logger');
  923 + $pIntIdRede = $rede->getIdRede();
  924 +
  925 + // Varre o diretório em busca dos módulos
  926 + $rootDir = $this->container->get('kernel')->getRootDir();
  927 + $webDir = $rootDir . "/../web/";
  928 + $downloadsDir = $webDir . "downloads/";
  929 + $cacicDir = $downloadsDir . "cacic/";
  930 + $linuxDir = $cacicDir . "linux/";
  931 + $windowsDir = $cacicDir . "windows/";
  932 + $outrosDir = $downloadsDir . "outros/";
  933 +
  934 + // Carrega todos os metadados dos módulos fornecidos ou de todos os módulos
  935 + $modulos = $this->modulosNeoArray($request, $modulos);
  936 + //$logger->debug("6666666666666666666666666666666666666 ".print_r($modulos, true));
  937 +
  938 + foreach ($modulos as $key => $value)
  939 + {
  940 + $logger->debug("Nome do módulo: $key");
  941 +
  942 + // Carrega dados da rede
  943 + $em = $this->getDoctrine()->getManager();
  944 + //$arrDadosRede = array( 'rede' => $em->getRepository( 'CacicCommonBundle:Rede' )->listar() );
  945 + //Debug::dump($arrDadosRede['rede'][0][0]);
  946 + //$arrDadosRede = $arrDadosRede['rede'][0];
  947 + $arrDadosRede = array(
  948 + 'teServUpdates' => $rede->getTeServUpdates(),
  949 + 'tePathServUpdates' => $rede->getTePathServUpdates(),
  950 + 'nmUsuarioLoginServUpdatesGerente' => $rede->getNmUsuarioLoginServUpdatesGerente(),
  951 + 'teSenhaLoginServUpdatesGerente' => $rede->getTeSenhaLoginServUpdatesGerente(),
  952 + 'nuPortaServUpdates' => $rede->getNuPortaServUpdates(),
  953 + );
  954 +
  955 + $strResult = $this->checkAndSend(
  956 + $value['name'],
  957 + $downloadsDir . $value['filename'],
  958 + $arrDadosRede['teServUpdates'],
  959 + $arrDadosRede['tePathServUpdates'],
  960 + $arrDadosRede['nmUsuarioLoginServUpdatesGerente'],
  961 + $arrDadosRede['teSenhaLoginServUpdatesGerente'],
  962 + $arrDadosRede['nuPortaServUpdates']
  963 + );
  964 +
  965 + $arrResult = explode('_=_',$strResult);
  966 +
  967 + if ($arrResult[1] == 'Ok!')
  968 + {
  969 + // Consertar CRUD no Symfony
  970 + $redeVersaoModulo = $em->getRepository('CacicCommonBundle:RedeVersaoModulo')->findOneBy(
  971 + array(
  972 + 'idRede' => $pIntIdRede,
  973 + 'nmModulo' => $value['name']
  974 + )
  975 + );
  976 +
  977 + // Se não existir, instancia o objeto
  978 + if (empty($redeVersaoModulo)) {
  979 + $redeVersaoModulo = new RedeVersaoModulo(null, null, null, null, null, $rede);
  980 + }
  981 +
  982 + // Adicione o restante dos atributos
  983 + $redeVersaoModulo->setNmModulo($value['name']);
  984 + $redeVersaoModulo->setTeVersaoModulo($value['versao']);
  985 + $redeVersaoModulo->setDtAtualizacao(new \DateTime('NOW'));
  986 + $redeVersaoModulo->setCsTipoSo( $value['tipoSo'] );
  987 + $redeVersaoModulo->setTeHash($value['hash']);
  988 + $redeVersaoModulo->setTipo('cacic');
  989 +
  990 + $em->persist($redeVersaoModulo);
  991 + $em->flush();
  992 + } else {
  993 + $logger->error("Erro no envio dos módulos via FTP!\n".$arrResult[1]);
  994 + return false;
  995 + }
  996 + }
  997 +
  998 + return true;
  999 + }
  1000 +
  1001 +}
... ...
src/Cacic/CommonBundle/Controller/SecurityController.php
... ... @@ -4,6 +4,7 @@ namespace Cacic\CommonBundle\Controller;
4 4  
5 5 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6 6 use Symfony\Component\Security\Core\SecurityContext;
  7 +use Symfony\Component\HttpFoundation\Request;
7 8  
8 9 /**
9 10 *
... ... @@ -18,10 +19,12 @@ class SecurityController extends Controller
18 19 *
19 20 * Tela de login do CACIC
20 21 */
21   - public function loginAction()
  22 + public function loginAction(Request $request)
22 23 {
23   - $objRequest = $this->getRequest();
24   - $objSession = $objRequest->getSession();
  24 + //$objRequest = $this->getRequest();
  25 + $logger = $this->get('logger');
  26 + $objRequest = $request;
  27 + $objSession = $request->getSession();
25 28  
26 29 # Recupera a mensagem de erro, se existir
27 30 if ( $objRequest->attributes->has( SecurityContext::AUTHENTICATION_ERROR ) )
... ... @@ -34,6 +37,8 @@ class SecurityController extends Controller
34 37 $objSession->remove( SecurityContext::AUTHENTICATION_ERROR ); // Apaga a mensagem de erro da sessão
35 38 }
36 39  
  40 + $logger->error("Erro de autenticação \n".$error);
  41 +
37 42 return $this->render(
38 43 'CacicCommonBundle:Security:login.html.twig',
39 44 array(
... ...
src/Cacic/CommonBundle/Controller/UsuarioController.php
... ... @@ -131,6 +131,23 @@ class UsuarioController extends Controller
131 131 throw $this->createNotFoundException( 'Usuário não encontrado' );
132 132  
133 133 $form = $this->createForm( new UsuarioType(), $usuario );
  134 +
  135 + // Check if user has permission to generate API
  136 + $securityContext = $this->container->get('security.context');
  137 + if ($securityContext->isGranted('ROLE_ADMIN')) {
  138 + $apiKey = $usuario->getApiKey();
  139 + if (empty($apiKey)) {
  140 + $apiKey = md5(uniqid(""));
  141 + }
  142 +
  143 + $form->add( 'api_key', 'text',
  144 + array(
  145 + 'label' => 'Chave de API',
  146 + 'required' => false,
  147 + 'data' => $apiKey
  148 + )
  149 + );
  150 + }
134 151  
135 152 if ( $request->isMethod('POST') )
136 153 {
... ...
src/Cacic/CommonBundle/DataFixtures/ORM/LoadClasseData.php
... ... @@ -77,6 +77,14 @@ The following syntax is simplified from Managed Object Format (MOF) code and inc
77 77 array('className' => 'Patrimonio',
78 78 'description' => 'Dados de patrimônio e localização física',
79 79 'reference' => 'Patrimonio'
  80 + ),
  81 + array('className' => 'Win32_SystemEnclosure',
  82 + 'description' => 'The Win32_SystemEnclosure WMI class represents the properties that are associated with a physical system enclosure',
  83 + 'reference' => 'SystemEnclosure'
  84 + ),
  85 + array('className' => 'Win32_DiskDrive',
  86 + 'description' => 'Discos',
  87 + 'reference' => 'DiskDrive'
80 88 )
81 89 );
82 90  
... ...
src/Cacic/CommonBundle/DataFixtures/ORM/LoadCollectDefClassData.php
... ... @@ -33,7 +33,9 @@ class LoadCollectDefClassData extends AbstractFixture implements FixtureInterfac
33 33 'PhysicalMemory',
34 34 'Processor',
35 35 'Printer',
36   - 'DesktopMonitor'
  36 + 'DesktopMonitor',
  37 + 'SystemEnclosure',
  38 + 'DiskDrive'
37 39 )),
38 40 //array('id_acao'=>'col_moni','classes'=> array('ComputerSystem','Software', 'OperatingSystem')),
39 41 array('id_acao'=>'col_patr','classes'=> array('Patrimonio')),
... ...
src/Cacic/CommonBundle/DataFixtures/ORM/LoadGrupoUsuarioData.php
... ... @@ -36,11 +36,56 @@ class LoadGrupoUsuarioData extends AbstractFixture implements FixtureInterface,
36 36 $grupoAdmin->setTeMenuGrupo('menu_adm.txt');
37 37 $grupoAdmin->setTeDescricaoGrupo('Acesso irrestrito');
38 38 $grupoAdmin->setCsNivelAdministracao(true);
  39 + $grupoAdmin->setRole('ROLE_ADMIN');
39 40  
40 41 // Adiciona referência ao Grupo que será usada depois
41 42 $this->addReference('grupo-admin', $grupoAdmin);
42 43  
43 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 89 $manager->flush();
45 90  
46 91 }
... ...
src/Cacic/CommonBundle/DataFixtures/ORM/LoadUsuarioData.php
... ... @@ -40,6 +40,7 @@ class LoadUsuarioData extends AbstractFixture implements FixtureInterface, Conta
40 40 ->getEncoder($userAdmin)
41 41 ;
42 42 $userAdmin->setTeSenha($encoder->encodePassword('123456', $userAdmin->getSalt()));
  43 + $userAdmin->setApiKey('cacic123');
43 44  
44 45 //$userAdmin->setTeSenha('7c4a8d09ca3762af61e59520943dc26494f8941b');
45 46  
... ...
src/Cacic/CommonBundle/DoctrineMigrations/Version20141018220727.php 0 → 100644
... ... @@ -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/DoctrineMigrations/Version20141030153634.php 0 → 100644
... ... @@ -0,0 +1,68 @@
  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 +
  10 +/**
  11 + * Auto-generated Migration: Please modify to your needs!
  12 + */
  13 +class Version20141030153634 extends AbstractMigration implements ContainerAwareInterface
  14 +{
  15 + private $container;
  16 +
  17 + public function setContainer(ContainerInterface $container = null)
  18 + {
  19 + $this->container = $container;
  20 + }
  21 +
  22 + public function up(Schema $schema)
  23 + {
  24 + // this up() migration is auto-generated, please modify it to your needs
  25 + $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql", "Migration can only be executed safely on 'postgresql'.");
  26 + $logger = $this->container->get('logger');
  27 +
  28 + $this->addSql("
  29 + CREATE OR REPLACE FUNCTION conserta_propriedade() RETURNS VOID AS $$
  30 + DECLARE
  31 + impr record;
  32 + v_id integer;
  33 + BEGIN
  34 + FOR impr IN select id_class_property
  35 + from class_property
  36 + where id_class IS NULL LOOP
  37 +
  38 + RAISE NOTICE 'Removing property_id = %',impr.id_class_property;
  39 +
  40 + DELETE FROM computador_coleta_historico
  41 + WHERE id_class_property = impr.id_class_property;
  42 +
  43 + DELETE FROM computador_coleta
  44 + WHERE id_class_property = impr.id_class_property;
  45 +
  46 + DELETE FROM class_property
  47 + WHERE id_class_property = impr.id_class_property;
  48 +
  49 + END LOOP;
  50 + RETURN;
  51 + END;
  52 + $$ LANGUAGE 'plpgsql';
  53 + ");
  54 + $logger->info("Função de atualização das impressoras criada");
  55 + $this->addSql("SELECT conserta_propriedade();");
  56 + $logger->info("Propriedades nulas removaidas");
  57 + $this->addSql("ALTER TABLE class_property ALTER id_class SET NOT NULL;");
  58 + $logger->info("Índice único criado");
  59 +
  60 +
  61 + }
  62 +
  63 + public function down(Schema $schema)
  64 + {
  65 + // this down() migration is auto-generated, please modify it to your needs
  66 +
  67 + }
  68 +}
... ...
src/Cacic/CommonBundle/Entity/AcaoRepository.php
... ... @@ -59,4 +59,28 @@ class AcaoRepository extends EntityRepository
59 59 ->setParameters( array('idRede'=>$idRede, 'idSo'=>$idSo) )
60 60 ->getArrayResult();
61 61 }
  62 +
  63 + public function listaAcaoComputador( $idRede, $idSo, $te_node_address )
  64 + {
  65 + // Monta a Consulta básica...
  66 + $_dql = "SELECT DISTINCT
  67 + a.idAcao,
  68 + a.teNomeCurtoModulo,
  69 + a.teDescricaoBreve,
  70 + ar.dtHrColetaForcada,
  71 + aso as acaoExcecao
  72 + FROM CacicCommonBundle:Acao a
  73 + INNER JOIN a.redes ar
  74 + INNER JOIN ar.rede r
  75 + LEFT JOIN CacicCommonBundle:AcaoSo aso WITH (a.idAcao = aso.acao AND aso.so = :idSo)
  76 + LEFT JOIN CacicCommonBundle:AcaoExcecao e
  77 + WITH (e.acao = a.idAcao AND e.rede = :idRede AND e.teNodeAddress = :te_node_address)
  78 + WHERE r.idRede = :idRede
  79 + AND e.acao IS NULL";
  80 +
  81 + return $this->getEntityManager()
  82 + ->createQuery( $_dql )
  83 + ->setParameters( array('idRede'=>$idRede, 'idSo'=>$idSo, 'te_node_address' => $te_node_address) )
  84 + ->getArrayResult();
  85 + }
62 86 };
63 87 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Entity/ClassProperty.php
... ... @@ -172,4 +172,4 @@ class ClassProperty
172 172 {
173 173 return $this->nmPropertyName;
174 174 }
175   -}
176 175 \ No newline at end of file
  176 +}
... ...
src/Cacic/CommonBundle/Entity/ComputadorRepository.php
... ... @@ -499,4 +499,43 @@ class ComputadorRepository extends EntityRepository
499 499 return $query->getQuery()->execute();
500 500 }
501 501  
  502 + public function semMac($ip_computador, $so) {
  503 + $data = new \DateTime('NOW'); //armazena data Atual
  504 +
  505 + // Primeiro tenta encontrar pelo IP
  506 + $computador = $this->findOneBy( array( 'teIpComputador'=> $ip_computador, 'idSo'=> $so->getIdSo()) );
  507 +
  508 + if (empty($computador)) {
  509 + // Pega o primeiro computador da Rede Padrão
  510 + $qb = $this->createQueryBuilder('computador')
  511 + ->select('computador')
  512 + ->andwhere('computador.teIpComputador = :ip_computador')
  513 + ->andWhere('computador.idSo = :idSo')
  514 + ->innerJoin('CacicCommonBundle:Rede', 'rede', 'WITH', "computador.idRede = rede.idRede AND rede.teIpRede = '0.0.0.0'")
  515 + ->setMaxResults(1)
  516 + ->orderBy('computador.idComputador')
  517 + ->setParameter('ip_computador', $ip_computador)
  518 + ->setParameter('idSo', $so->getIdSo());
  519 +
  520 + try {
  521 + $computador = $qb->getQuery()->getSingleResult();
  522 + }
  523 + catch(\Doctrine\ORM\NoResultException $e) {
  524 + // Em último caso pega primeiro computador com menor Id
  525 + $qb = $this->createQueryBuilder('computador')
  526 + ->select('computador')
  527 + ->andWhere('computador.idSo = :idSo')
  528 + ->setMaxResults(1)
  529 + ->orderBy('computador.idComputador')
  530 + ->setParameter('idSo', $so->getIdSo());
  531 +
  532 + $computador = $qb->getQuery()->getOneOrNullResult();
  533 + }
  534 +
  535 + }
  536 +
  537 + return $computador;
  538 +
  539 + }
  540 +
502 541 }
... ...
src/Cacic/CommonBundle/Entity/GrupoUsuario.php
... ... @@ -164,4 +164,32 @@ class GrupoUsuario
164 164 {
165 165 return $this->csNivelAdministracao;
166 166 }
167   -}
168 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/LogAcesso.php
... ... @@ -88,12 +88,12 @@ class LogAcesso
88 88 {
89 89 $this->data = new \DateTime();
90 90 }
91   -
92 91 /**
93 92 * @var string
94 93 */
95 94 private $usuario;
96 95  
  96 +
97 97 /**
98 98 * Set usuario
99 99 *
... ... @@ -110,7 +110,7 @@ class LogAcesso
110 110 /**
111 111 * Get usuario
112 112 *
113   - * @return string
  113 + * @return string
114 114 */
115 115 public function getUsuario()
116 116 {
... ...
src/Cacic/CommonBundle/Entity/PropriedadeSoftwareRepository.php
... ... @@ -29,4 +29,15 @@ class PropriedadeSoftwareRepository extends EntityRepository
29 29 return $qb->getQuery()->execute();
30 30 }
31 31  
  32 +
  33 + public function softwareByName( $nmSoftware ) {
  34 + $qb = $this->createQueryBuilder('prop')
  35 + ->select('prop')
  36 + ->innerJoin('CacicCommonBundle:classProperty', 'cp', 'WITH', 'prop.classProperty = cp.idClassProperty')
  37 + ->andWhere('cp.nmPropertyName = :nmSoftware')
  38 + ->setParameter('nmSoftware', $nmSoftware);
  39 +
  40 + return $qb->getQuery()->getOneOrNullResult();
  41 + }
  42 +
32 43 }
... ...
src/Cacic/CommonBundle/Entity/Rede.php
... ... @@ -846,4 +846,60 @@ class Rede
846 846 {
847 847 return $this->uorgs;
848 848 }
849   -}
850 849 \ No newline at end of file
  850 + /**
  851 + * @var string
  852 + */
  853 + private $downloadMethod;
  854 +
  855 +
  856 + /**
  857 + * Set downloadMethod
  858 + *
  859 + * @param string $downloadMethod
  860 + * @return Rede
  861 + */
  862 + public function setDownloadMethod($downloadMethod)
  863 + {
  864 + $this->downloadMethod = $downloadMethod;
  865 +
  866 + return $this;
  867 + }
  868 +
  869 + /**
  870 + * Get downloadMethod
  871 + *
  872 + * @return string
  873 + * Caso não esteja cadastrado retorna FTP por padrão
  874 + */
  875 + public function getDownloadMethod()
  876 + {
  877 + if (empty($this->downloadMethod)) {
  878 + return "ftp";
  879 + } else {
  880 + return $this->downloadMethod;
  881 + }
  882 + }
  883 +
  884 + /**
  885 + * Add acoes
  886 + *
  887 + * @param \Cacic\CommonBundle\Entity\AcaoRede $acoes
  888 + * @return Rede
  889 + */
  890 + public function addAco(\Cacic\CommonBundle\Entity\AcaoRede $acoes)
  891 + {
  892 + $this->acoes[] = $acoes;
  893 +
  894 + return $this;
  895 + }
  896 +
  897 + /**
  898 + * Remove acoes
  899 + *
  900 + * @param \Cacic\CommonBundle\Entity\AcaoRede $acoes
  901 + */
  902 + public function removeAco(\Cacic\CommonBundle\Entity\AcaoRede $acoes)
  903 + {
  904 + $this->acoes->removeElement($acoes);
  905 + }
  906 +}
... ...
src/Cacic/CommonBundle/Entity/RedeVersaoModulo.php
... ... @@ -211,4 +211,32 @@ class RedeVersaoModulo
211 211 }
212 212  
213 213  
214   -}
215 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
... ... @@ -5,11 +5,14 @@ namespace Cacic\CommonBundle\Entity;
5 5 use Doctrine\ORM\Mapping as ORM;
6 6 use Symfony\Component\Security\Core\User\UserInterface;
7 7 use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8 +use Symfony\Component\Security\Core\User\EquatableInterface;
  9 +use Symfony\Component\Security\Core\User\AdvancedUserInterface;
  10 +use Symfony\Component\Validator\Constraints\True;
8 11  
9 12 /**
10 13 * Usuario
11 14 */
12   -class Usuario implements UserInterface, \Serializable
  15 +class Usuario implements AdvancedUserInterface, \Serializable, EquatableInterface
13 16 {
14 17 /**
15 18 * @var integer
... ... @@ -380,7 +383,12 @@ class Usuario implements UserInterface, \Serializable
380 383 */
381 384 public function getRoles()
382 385 {
383   - 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 + }
384 392 }
385 393  
386 394 /**
... ... @@ -455,4 +463,158 @@ class Usuario implements UserInterface, \Serializable
455 463 {
456 464 return $this->locaisSecundarios;
457 465 }
458   -}
459 466 \ No newline at end of file
  467 + /**
  468 + * @var string
  469 + */
  470 + private $apiKey;
  471 +
  472 +
  473 + /**
  474 + * Set apiKey
  475 + *
  476 + * @param string $apiKey
  477 + * @return Usuario
  478 + */
  479 + public function setApiKey($apiKey)
  480 + {
  481 + $this->apiKey = $apiKey;
  482 +
  483 + return $this;
  484 + }
  485 +
  486 + /**
  487 + * Get apiKey
  488 + *
  489 + * @return string
  490 + */
  491 + public function getApiKey()
  492 + {
  493 + return $this->apiKey;
  494 + }
  495 +
  496 + /**
  497 + * @var string
  498 + */
  499 + private $cryptKey;
  500 +
  501 +
  502 + /**
  503 + * Set cryptKey
  504 + *
  505 + * @param string $cryptKey
  506 + * @return Usuario
  507 + */
  508 + public function setCryptKey($cryptKey)
  509 + {
  510 + $this->cryptKey = $cryptKey;
  511 +
  512 + return $this;
  513 + }
  514 +
  515 + /**
  516 + * Get cryptKey
  517 + *
  518 + * @return string
  519 + */
  520 + public function getCryptKey()
  521 + {
  522 + return $this->cryptKey;
  523 + }
  524 +
  525 + /**
  526 + * Método que localizar usuário por parâmetros
  527 + *
  528 + * @param UserInterface $user
  529 + * @return bool
  530 + */
  531 + public function isEqualTo(UserInterface $user)
  532 + {
  533 + if (!$user instanceof Usuario) {
  534 + return false;
  535 + }
  536 +
  537 + if ($this->teSenha !== $user->getPassword()) {
  538 + return false;
  539 + }
  540 +
  541 +
  542 + if ($this->nmUsuarioAcesso !== $user->getUsername()) {
  543 + return false;
  544 + }
  545 +
  546 + return true;
  547 + }
  548 +
  549 + /**
  550 + * Conta expirada
  551 + *
  552 + * @return bool
  553 + */
  554 + public function isAccountNonExpired()
  555 + {
  556 + return true;
  557 + }
  558 +
  559 + /**
  560 + * Conta travada
  561 + *
  562 + * @return bool
  563 + */
  564 + public function isAccountNonLocked()
  565 + {
  566 + return true;
  567 + }
  568 +
  569 + /**
  570 + * Credenciais expiradas
  571 + *
  572 + * @return bool
  573 + */
  574 + public function isCredentialsNonExpired()
  575 + {
  576 + return true;
  577 + }
  578 +
  579 + /**
  580 + * Usuário ativo
  581 + *
  582 + * @return bool
  583 + */
  584 + public function isEnabled()
  585 + {
  586 + return true;
  587 + //return $this->isActive;
  588 + }
  589 +
  590 + /**
  591 + * FIXME: Criar interface para ativar e desativar usuários
  592 + *
  593 + * @var boolean
  594 + */
  595 + private $isActive;
  596 +
  597 +
  598 + /**
  599 + * Set isActive
  600 + *
  601 + * @param boolean $isActive
  602 + * @return Usuario
  603 + */
  604 + public function setIsActive($isActive)
  605 + {
  606 + $this->isActive = $isActive;
  607 +
  608 + return $this;
  609 + }
  610 +
  611 + /**
  612 + * Get isActive
  613 + *
  614 + * @return boolean
  615 + */
  616 + public function getIsActive()
  617 + {
  618 + return true;
  619 + //return $this->isActive;
  620 + }
  621 +}
... ...
src/Cacic/CommonBundle/Entity/UsuarioRepository.php
... ... @@ -34,13 +34,13 @@ class UsuarioRepository extends EntityRepository
34 34 * Método que apresenta o grupo de acesso do respectivo usuario
35 35 */
36 36 public function nivel($usuario){
37   - $_dql = "SELECT g.teGrupoUsuarios
  37 + $_dql = "SELECT g.nmGrupoUsuarios
38 38 FROM CacicCommonBundle:Usuario u
39 39 JOIN u.idLocal l
40 40 JOIN u.idGrupoUsuario g
41 41 LEFT JOIN u.locaisSecundarios ls
42 42 WHERE u.idUsuario = :idUsuario
43   - GROUP BY g.teGrupoUsuarios";
  43 + GROUP BY g.nmGrupoUsuarios";
44 44  
45 45 return $this->getEntityManager()
46 46 ->createQuery( $_dql )
... ...
src/Cacic/CommonBundle/Form/Type/AgenteType.php 0 → 100644
... ... @@ -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 63 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Form/Type/DeployType.php 0 → 100644
... ... @@ -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 44 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Form/Type/RedeType.php
... ... @@ -69,7 +69,19 @@ class RedeType extends AbstractType
69 69 );
70 70 $builder->add('teServUpdates', null,
71 71 array(
72   - 'label'=>'Servidor de Updates (FTP)'
  72 + 'label'=>'Servidor para download dos Agentes'
  73 + )
  74 + );
  75 + $builder->add('downloadMethod', 'choice',
  76 + array(
  77 + 'label'=>'Método de download',
  78 + 'choices' => array(
  79 + 'ftp' => 'FTP',
  80 + 'http' => 'HTTP'
  81 + ),
  82 + 'required' => true,
  83 + 'data' => 'ftp',
  84 + //'expanded' => true,
73 85 )
74 86 );
75 87 $builder->add('selTeServUpdates', 'entity',
... ... @@ -209,4 +221,4 @@ class RedeType extends AbstractType
209 221 }
210 222  
211 223  
212   -}
213 224 \ No newline at end of file
  225 +}
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/ClassProperty.orm.yml
... ... @@ -39,5 +39,6 @@ Cacic\CommonBundle\Entity\ClassProperty:
39 39 joinColumns:
40 40 id_class:
41 41 referencedColumnName: id_class
  42 + nullable: false
42 43 orphanRemoval: false
43 44 lifecycleCallbacks: { }
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/Computador.orm.yml
... ... @@ -51,7 +51,7 @@ Cacic\CommonBundle\Entity\Computador:
51 51 tePalavraChave:
52 52 type: text
53 53 fixed: true
54   - nullable: false
  54 + nullable: true
55 55 column: te_palavra_chave
56 56 forcaColeta:
57 57 type: text
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/GrupoUsuario.orm.yml
... ... @@ -34,4 +34,8 @@ Cacic\CommonBundle\Entity\GrupoUsuario:
34 34 type: integer
35 35 nullable: true
36 36 column: cs_nivel_administracao
  37 + role:
  38 + type: text
  39 + nullable: true
  40 + column: role
37 41 lifecycleCallbacks: { }
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/Rede.orm.yml
... ... @@ -124,6 +124,10 @@ Cacic\CommonBundle\Entity\Rede:
124 124 fixed: true
125 125 nullable: true
126 126 column: dt_debug
  127 + downloadMethod:
  128 + type: text
  129 + nullable: true
  130 + column: download_method
127 131 manyToMany:
128 132 idAplicativo:
129 133 targetEntity: Aplicativo
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/RedeVersaoModulo.orm.yml
... ... @@ -35,6 +35,11 @@ Cacic\CommonBundle\Entity\RedeVersaoModulo:
35 35 fixed: false
36 36 nullable: true
37 37 column: te_hash
  38 + tipo:
  39 + type: text
  40 + fixed: false
  41 + nullable: true
  42 + column: tipo
38 43 manyToOne:
39 44 idRede:
40 45 targetEntity: Rede
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/Usuario.orm.yml
... ... @@ -50,6 +50,21 @@ Cacic\CommonBundle\Entity\Usuario:
50 50 fixed: false
51 51 nullable: true
52 52 column: te_telefones_contato
  53 + apiKey:
  54 + type: text
  55 + fixed: false
  56 + nullable: true
  57 + column: api_key
  58 + cryptKey:
  59 + type: text
  60 + fixed: false
  61 + nullable: true
  62 + column: crypt_key
  63 + isActive:
  64 + type: boolean
  65 + fixed: false
  66 + nullable: true
  67 + column: is_active
53 68 manyToMany:
54 69 locaisSecundarios:
55 70 targetEntity: Local
... ... @@ -92,4 +107,9 @@ Cacic\CommonBundle\Entity\Usuario:
92 107 referencedColumnName: id_grupo_usuario
93 108 nullable: false
94 109 orphanRemoval: false
  110 + uniqueConstraints:
  111 + api_key_uq_idx:
  112 + columns: [ api_key ]
  113 + crypt_key_uq_idx:
  114 + columns: [ crypt_key ]
95 115 lifecycleCallbacks: { }
... ...
src/Cacic/CommonBundle/Resources/config/routing.yml
... ... @@ -16,392 +16,482 @@ cacic_common_instalador:
16 16 pattern: /instalador
17 17 defaults: { _controller: CacicCommonBundle:Instalador:index }
18 18  
  19 +###########################################
  20 +# INÍCIO: Páginas restritas aos administradores
  21 +#############################################
  22 +
  23 +# Usuários
  24 +
19 25 cacic_usuario_index:
20   - pattern: /usuarios/{page}
  26 + pattern: /admin/usuarios/{page}
21 27 defaults: { _controller: CacicCommonBundle:Usuario:index, page: 1 }
22 28 requirements:
23 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 31 cacic_usuario_cadastrar:
38   - pattern: /usuario/cadastrar
  32 + pattern: /admin/usuario/cadastrar
39 33 defaults: { _controller: CacicCommonBundle:Usuario:cadastrar}
40 34  
41 35 cacic_usuario_editar:
42   - pattern: /usuario/editar/{idUsuario}
  36 + pattern: /admin/usuario/editar/{idUsuario}
43 37 defaults: { _controller: CacicCommonBundle:Usuario:editar, idUsuario: null}
44 38 requirements:
45 39 idUsuario: \d+
46 40  
47 41 cacic_usuario_excluir:
48   - pattern: /usuario/excluir
  42 + pattern: /admin/usuario/excluir
49 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 47 cacic_local_index:
57   - pattern: /local/{page}
  48 + pattern: /admin/local/{page}
58 49 defaults: { _controller: CacicCommonBundle:Local:index, page: 1 }
59 50 requirements:
60 51 page: \d+
61 52  
62 53 cacic_local_cadastrar:
63   - pattern: /local/cadastrar
  54 + pattern: /admin/local/cadastrar
64 55 defaults: { _controller: CacicCommonBundle:Local:cadastrar}
65 56  
66 57 cacic_local_editar:
67   - pattern: /local/editar/{idLocal}
  58 + pattern: /admin/local/editar/{idLocal}
68 59 defaults: { _controller: CacicCommonBundle:Local:editar}
69 60 requirements:
70 61 idLocal: \d+
71 62  
72 63 cacic_local_excluir:
73   - pattern: /local/excluir
  64 + pattern: /admin/local/excluir
74 65 defaults: { _controller: CacicCommonBundle:Local:excluir}
75 66  
76 67 cacic_local_redesassociadas:
77   - pattern: /local/redes/{idLocal}
  68 + pattern: /admin/local/redes/{idLocal}
78 69 defaults: { _controller: CacicCommonBundle:Local:redes}
79 70 requirements:
80 71 idLocal: \d+
81 72  
82 73 cacic_local_usuariosassociados:
83   - pattern: /local/usuarios/{idLocal}
  74 + pattern: /admin/local/usuarios/{idLocal}
84 75 defaults: { _controller: CacicCommonBundle:Local:usuarios}
85 76 requirements:
86 77 idLocal: \d+
87 78  
88 79 cacic_local_configuracoes:
89   - pattern: /local/configuracoes/{idLocal}
  80 + pattern: /admin/local/configuracoes/{idLocal}
90 81 defaults: { _controller: CacicCommonBundle:Local:configuracoes}
91 82 requirements:
92 83 idLocal: \d+
93 84  
94 85 cacic_servidorautenticacao_index:
95   - pattern: /servidorautenticacao/{page}
  86 + pattern: /admin/servidorautenticacao/{page}
96 87 defaults: {_controller: CacicCommonBundle:ServidorAutenticacao:index, page: 1 }
97 88 requirements:
98 89 page: \d+
99 90  
100 91 cacic_servidorautenticacao_cadastrar:
101   - pattern: /servidorautenticacao/cadastrar
  92 + pattern: /admin/servidorautenticacao/cadastrar
102 93 defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:cadastrar}
103 94  
104 95 cacic_servidorautenticacao_editar:
105   - pattern: /servidorautenticacao/editar/{idServidorAutenticacao}
  96 + pattern: /admin/servidorautenticacao/editar/{idServidorAutenticacao}
106 97 defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:editar}
107 98 requirements:
108 99 idLocal: \d+
109 100  
110 101 cacic_servidorautenticacao_excluir:
111   - pattern: /servidorautenticacao/excluir
  102 + pattern: /admin/servidorautenticacao/excluir
112 103 defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:excluir}
113 104  
114 105 cacic_servidorautenticacao_redesassociadas:
115   - pattern: /servidorautenticacao/redes/{idServidorAutenticacao}
  106 + pattern: /admin/servidorautenticacao/redes/{idServidorAutenticacao}
116 107 defaults: { _controller: CacicCommonBundle:ServidorAutenticacao:redes}
117 108 requirements:
118 109 idLocal: \d+
119 110  
  111 +# Subredes
  112 +
120 113 cacic_subrede_index:
121   - pattern: /subrede/{page}
  114 + pattern: /admin/subrede/{page}
122 115 defaults: {_controller: CacicCommonBundle:Rede:index, page: 1 }
123 116 requirements:
124 117 page: \d+
125 118  
126 119 cacic_subrede_cadastrar:
127   - pattern: /subrede/cadastrar
  120 + pattern: /admin/subrede/cadastrar
128 121 defaults: { _controller: CacicCommonBundle:Rede:cadastrar}
129 122  
130 123 cacic_subrede_editar:
131   - pattern: /subrede/editar/{idRede}
  124 + pattern: /admin/subrede/editar/{idRede}
132 125 defaults: { _controller: CacicCommonBundle:Rede:editar}
133 126 requirements:
134 127 idRede: \d+
135 128  
136 129 cacic_subrede_excluir:
137   - pattern: /subrede/excluir
  130 + pattern: /admin/subrede/excluir
138 131 defaults: { _controller: CacicCommonBundle:Rede:excluir}
139 132  
140 133 cacic_subrede_manutencao:
141   - pattern: /subrede/manutencao
  134 + pattern: /admin/subrede/manutencao
142 135 defaults: { _controller: CacicCommonBundle:Rede:manutencao}
143 136  
144 137 cacic_subrede_vincular:
145   - pattern: /subrede/vincular
  138 + pattern: /admin/subrede/vincular
146 139 defaults: { _controller: CacicCommonBundle:Rede:vincular}
147 140  
148 141 cacic_subrede_computadores:
149   - pattern: /subrede/computadores
  142 + pattern: /admin/subrede/computadores
150 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 332 cacic_aplicativo_index:
153   - pattern: /aplicativo/{page}
  333 + pattern: /manutencao/aplicativo/{page}
154 334 defaults: {_controller: CacicCommonBundle:Aplicativo:index, page: 1 }
155 335 requirements:
156 336 page: \d+
157 337  
158 338 cacic_aplicativo_cadastrar:
159   - pattern: /aplicativo/cadastrar
  339 + pattern: /manutencao/aplicativo/cadastrar
160 340 defaults: { _controller: CacicCommonBundle:Aplicativo:cadastrar}
161 341  
162 342 cacic_aplicativo_editar:
163   - pattern: /aplicativo/editar/{idAplicativo}
  343 + pattern: /manutencao/aplicativo/editar/{idAplicativo}
164 344 defaults: { _controller: CacicCommonBundle:Aplicativo:editar}
165 345 requirements:
166 346 idAplicativo: \d+
167 347  
168 348 cacic_aplicativo_excluir:
169   - pattern: /aplicativo/excluir
  349 + pattern: /manutencao/aplicativo/excluir
170 350 defaults: { _controller: CacicCommonBundle:Aplicativo:excluir}
171 351  
172 352  
173 353 cacic_tiposoftware_index:
174   - pattern: /tiposoftware/{page}
  354 + pattern: /manutencao/tiposoftware/{page}
175 355 defaults: {_controller: CacicCommonBundle:TipoSoftware:index, page: 1 }
176 356 requirements:
177 357 page: \d+
178 358  
179 359 cacic_tiposoftware_cadastrar:
180   - pattern: /tiposoftware/cadastrar
  360 + pattern: /manutencao/tiposoftware/cadastrar
181 361 defaults: { _controller: CacicCommonBundle:TipoSoftware:cadastrar}
182 362  
183 363 cacic_tiposoftware_editar:
184   - pattern: /tiposoftware/editar/{idTipoSoftware}
  364 + pattern: /manutencao/tiposoftware/editar/{idTipoSoftware}
185 365 defaults: { _controller: CacicCommonBundle:TipoSoftware:editar}
186 366 requirements:
187 367 idTipoSoftware: \d+
188 368  
189 369 cacic_tiposoftware_excluir:
190   - pattern: /tiposoftware/excluir
  370 + pattern: /manutencao/tiposoftware/excluir
191 371 defaults: { _controller: CacicCommonBundle:TipoSoftware:excluir}
192 372  
193 373 cacic_sistemaoperacional_index:
194   - pattern: /sistemaoperacional/{page}
  374 + pattern: /manutencao/sistemaoperacional/{page}
195 375 defaults: {_controller: CacicCommonBundle:So:index, page: 1 }
196 376 requirements:
197 377 page: \d+
198 378  
199 379 cacic_sistemaoperacional_cadastrar:
200   - pattern: /sistemaoperacional/cadastrar
  380 + pattern: /manutencao/sistemaoperacional/cadastrar
201 381 defaults: { _controller: CacicCommonBundle:So:cadastrar}
202 382  
203 383 cacic_sistemaoperacional_editar:
204   - pattern: /sistemaoperacional/editar/{idSo}
  384 + pattern: /manutencao/sistemaoperacional/editar/{idSo}
205 385 defaults: { _controller: CacicCommonBundle:So:editar}
206 386 requirements:
207 387 idSo: \d+
208 388  
209 389 cacic_sistemaoperacional_excluir:
210   - pattern: /sistemaoperacional/excluir
  390 + pattern: /manutencao/sistemaoperacional/excluir
211 391 defaults: { _controller: CacicCommonBundle:So:excluir}
212 392  
213 393 cacic_software_index:
214   - pattern: /software/{page}
  394 + pattern: /manutencao/software/{page}
215 395 defaults: {_controller: CacicCommonBundle:Software:index, page: 1 }
216 396 requirements:
217 397 page: \d+
218 398  
219 399 cacic_software_cadastrar:
220   - pattern: /software/cadastrar
  400 + pattern: /manutencao/software/cadastrar
221 401 defaults: { _controller: CacicCommonBundle:Software:cadastrar}
222 402  
223 403 cacic_software_editar:
224   - pattern: /software/editar/{idSoftware}
  404 + pattern: /manutencao/software/editar/{idSoftware}
225 405 defaults: { _controller: CacicCommonBundle:Software:editar}
226 406 requirements:
227 407 idSoftware: \d+
228 408  
229 409 cacic_software_excluir:
230   - pattern: /software/excluir
  410 + pattern: /manutencao/software/excluir
231 411 defaults: { _controller: CacicCommonBundle:Software:excluir}
232 412  
233 413 cacic_software_naoclassificados:
234   - pattern: /software/naoclassificados/{page}
  414 + pattern: /manutencao/software/naoclassificados/{page}
235 415 defaults: { _controller: CacicCommonBundle:Software:naoClassificados, page:1}
236 416 requirements:
237 417 page: \d+
238 418  
239 419 cacic_software_naousados:
240   - pattern: /software/naousados/{page}
  420 + pattern: /manutencao/software/naousados/{page}
241 421 defaults: { _controller: CacicCommonBundle:Software:naoUsados, page:1}
242 422 requirements:
243 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 425 cacic_usbdevice_index:
270   - pattern: /usbdevice/{page}
  426 + pattern: /manutencao/usbdevice/{page}
271 427 defaults: {_controller: CacicCommonBundle:UsbDevice:index, page: 1 }
272 428 requirements:
273 429 page: \d+
274 430  
275 431 cacic_usbdevice_cadastrar:
276   - pattern: /usbdevice/cadastrar
  432 + pattern: /manutencao/usbdevice/cadastrar
277 433 defaults: { _controller: CacicCommonBundle:UsbDevice:cadastrar}
278 434  
279 435 cacic_usbdevice_editar:
280   - pattern: /usbdevice/editar/{idUsbDevice}
  436 + pattern: /manutencao/usbdevice/editar/{idUsbDevice}
281 437 defaults: { _controller: CacicCommonBundle:UsbDevice:editar}
282 438  
283 439 cacic_usbdevice_excluir:
284   - pattern: /usbdevice/excluir
  440 + pattern: /manutencao/usbdevice/excluir
285 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 443 cacic_aquisicao_index:
354   - pattern: /aquisicao/{page}
  444 + pattern: /manutencao/aquisicao/{page}
355 445 defaults: {_controller: CacicCommonBundle:Aquisicao:index, page: 1 }
356 446 requirements:
357 447 page: \d+
358 448  
359 449 cacic_aquisicao_cadastrar:
360   - pattern: /aquisicao/cadastrar
  450 + pattern: /manutencao/aquisicao/cadastrar
361 451 defaults: { _controller: CacicCommonBundle:Aquisicao:cadastrar}
362 452  
363 453 cacic_aquisicao_editar:
364   - pattern: /aquisicao/editar/{idAquisicao}
  454 + pattern: /manutencao/aquisicao/editar/{idAquisicao}
365 455 defaults: { _controller: CacicCommonBundle:Aquisicao:editar}
366 456 requirements:
367 457 idAquisicao: \d+
368 458  
369 459 cacic_aquisicao_excluir:
370   - pattern: /aquisicao/excluir
  460 + pattern: /manutencao/aquisicao/excluir
371 461 defaults: { _controller: CacicCommonBundle:Aquisicao:excluir}
372 462  
373 463 cacic_tipo_licenca_index:
374   - pattern: /tipolicenca/{page}
  464 + pattern: /manutencao/tipolicenca/{page}
375 465 defaults: {_controller: CacicCommonBundle:TipoLicenca:index, page: 1 }
376 466 requirements:
377 467 page: \d+
378 468  
379 469 cacic_tipo_licenca_cadastrar:
380   - pattern: /tipolicenca/cadastrar
  470 + pattern: /manutencao/tipolicenca/cadastrar
381 471 defaults: { _controller: CacicCommonBundle:TipoLicenca:cadastrar}
382 472  
383 473 cacic_tipo_licenca_editar:
384   - pattern: /tipolicenca/editar/{idTipoLicenca}
  474 + pattern: /manutencao/tipolicenca/editar/{idTipoLicenca}
385 475 defaults: { _controller: CacicCommonBundle:TipoLicenca:editar}
386 476 requirements:
387 477 idTipoLicenca: \d+
388 478  
389 479 cacic_tipo_licenca_excluir:
390   - pattern: /tipolicenca/excluir
  480 + pattern: /manutencao/tipolicenca/excluir
391 481 defaults: { _controller: CacicCommonBundle:TipoLicenca:excluir}
392 482  
393 483 cacic_aquisicao_item_index:
394   - pattern: /aquisicaoitem/{page}
  484 + pattern: /manutencao/aquisicaoitem/{page}
395 485 defaults: {_controller: CacicCommonBundle:AquisicaoItem:index, page: 1 }
396 486 requirements:
397 487 page: \d+
398 488  
399 489 cacic_aquisicao_item_cadastrar:
400   - pattern: /aquisicaoitem/cadastrar
  490 + pattern: /manutencao/aquisicaoitem/cadastrar
401 491 defaults: { _controller: CacicCommonBundle:AquisicaoItem:cadastrar}
402 492  
403 493 cacic_aquisicao_item_editar:
404   - pattern: /aquisicaoitem/editar/{idAquisicao}/{idSoftware}/{idTipoLicenca}
  494 + pattern: /manutencao/aquisicaoitem/editar/{idAquisicao}/{idSoftware}/{idTipoLicenca}
405 495 defaults: { _controller: CacicCommonBundle:AquisicaoItem:editar}
406 496 requirements:
407 497 idSoftware: \d+
... ... @@ -409,30 +499,62 @@ cacic_aquisicao_item_editar:
409 499 idAquisicao: \d+
410 500  
411 501 cacic_aquisicao_item_excluir:
412   - pattern: /aquisicaoitem/excluir
  502 + pattern: /manutencao/aquisicaoitem/excluir
413 503 defaults: { _controller: CacicCommonBundle:AquisicaoItem:excluir}
414 504  
415 505 cacic_software_estacao_index:
416   - pattern: /softwareestacao/{page}
  506 + pattern: /manutencao/softwareestacao/{page}
417 507 defaults: {_controller: CacicCommonBundle:SoftwareEstacao:index, page: 1 }
418 508 requirements:
419 509 page: \d+
420 510  
421 511 cacic_software_estacao_cadastrar:
422   - pattern: /softwareestacao/cadastrar
  512 + pattern: /manutencao/softwareestacao/cadastrar
423 513 defaults: { _controller: CacicCommonBundle:SoftwareEstacao:cadastrar}
424 514  
425 515 cacic_software_estacao_editar:
426   - pattern: /softwareestacao/editar/{idComputador}/{idSoftware}
  516 + pattern: /manutencao/softwareestacao/editar/{idComputador}/{idSoftware}
427 517 defaults: { _controller: CacicCommonBundle:SoftwareEstacao:editar}
428 518 requirements:
429 519 idSoftware: \d+
430 520 idComputador: \d+
431 521  
432 522 cacic_software_estacao_excluir:
433   - pattern: /softwareestacao/excluir
  523 + pattern: /manutencao/softwareestacao/excluir
434 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 558 cacic_computador_buscar:
437 559 pattern: /computadores/buscar
438 560 defaults: { _controller: CacicCommonBundle:Computador:buscar}
... ... @@ -445,12 +567,6 @@ cacic_computador_consultar:
445 567 pattern: /computadores/consultar
446 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 570 cacic_computador_detalhar:
455 571 pattern: /computador/detalhar/{idComputador}
456 572 defaults: { _controller: CacicCommonBundle:Computador:detalhar, idComputador: null }
... ... @@ -469,72 +585,10 @@ cacic_computador_loadcompnodes:
469 585 requirements:
470 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 588 cacic_downloads:
501 589 pattern: /downloads/
502 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 592 \ No newline at end of file
  593 +############################################
  594 +# FIM: Páginas para usuários normais
  595 +############################################
542 596 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Resources/views/Agente/deploy.html.twig 0 → 100644
... ... @@ -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 128 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Resources/views/Agente/index.html.twig 0 → 100644
... ... @@ -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 213 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Resources/views/Agente/listar.html.twig 0 → 100644
... ... @@ -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 14 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Resources/views/Computador/detalhar.html.twig
... ... @@ -140,4 +140,4 @@
140 140 .table tbody th { text-align: right; }
141 141 -->
142 142 </style>
143   -{% endblock %}
144 143 \ No newline at end of file
  144 +{% endblock %}
... ...
src/Cacic/CommonBundle/Resources/views/Default/index.html.twig
... ... @@ -4,7 +4,7 @@
4 4  
5 5 <div class="row-fluid">
6 6  
7   - {% if nivel['teGrupoUsuarios'] == 'Administração' %}
  7 + {% if nivel['nmGrupoUsuarios'] == 'Admin' %}
8 8 <div class="span6 column ui-sortable" id="col0">
9 9 <div class="box grad_colour_black" id="box0">
10 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/cadastrar.html.twig
... ... @@ -37,6 +37,7 @@
37 37 <fieldset>
38 38 <legend>{{ "Servidores de"|trans }} Update </legend>
39 39 {{ form_row(form.teServUpdates, {'form_type': 'horizontal'} ) }}
  40 + {{ form_row(form.downloadMethod, {'form_type': 'horizontal'} ) }}
40 41 {{ form_row(form.selTeServUpdates, {'form_type': 'horizontal'} ) }}
41 42 {{ form_row(form.nuPortaServUpdates, {'form_type': 'horizontal'} ) }}
42 43 {{ form_row(form.nuLimiteFtp, {'form_type': 'horizontal'} ) }}
... ... @@ -151,4 +152,4 @@
151 152  
152 153 </script>
153 154  
154   -{% endblock %}
155 155 \ No newline at end of file
  156 +{% endblock %}
... ...
src/Cacic/CommonBundle/Resources/views/Rede/manutencaoNeo.html.twig 0 → 100644
... ... @@ -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 %}
... ...
src/Cacic/CommonBundle/Resources/views/Security/login.html.twig
... ... @@ -60,14 +60,15 @@
60 60 </div> <!-- /navbar -->
61 61  
62 62 <div class="account-container">
  63 +
63 64 <div class="content clearfix">
64   -
65   - {% if error %}
66   - <div id="credentials-error">{{ error.message }}</div>
67   - {% endif %}
68 65  
69 66 <form action="{{ path('cacic_common_login_check') }}" method="post">
70   - <h1>{{"Acesso"|trans}}</h1>
  67 + <h1>{{"Acesso"|trans}}</h1>
  68 +
  69 + {% if error %}
  70 + <div id="credentials-error" class="alert alert-danger" style="display: block;"><p>{{ "Falha no login. Verifique suas credenciais ou entre em contato com o administrador do sistema"|trans }}</p></div>
  71 + {% endif %}
71 72  
72 73 <div class="login-fields">
73 74  
... ...
src/Cacic/CommonBundle/Tests/BaseTestCase.php 0 → 100644
... ... @@ -0,0 +1,49 @@
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: eduardo
  5 + * Date: 07/10/14
  6 + * Time: 12:47
  7 + */
  8 +
  9 +namespace Cacic\CommonBundle\Tests;
  10 +
  11 +use Liip\FunctionalTestBundle\Test\WebTestCase;
  12 +
  13 +
  14 +class BaseTestCase extends WebTestCase {
  15 +
  16 + /**
  17 + * Método construtor
  18 + */
  19 + public function __construct() {
  20 + // Fixtures to be loaded on tests
  21 + $this->classes = array(
  22 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadLocalData',
  23 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadRedeData',
  24 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadClasseData',
  25 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadClassPropertyData',
  26 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadAcaoData',
  27 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadCollectDefClassData',
  28 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadConfiguracaoPadraoData',
  29 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadConfiguracaoLocalData',
  30 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadGrupoUsuarioData',
  31 + 'Cacic\CommonBundle\DataFixtures\ORM\LoadUsuarioData',
  32 + );
  33 + }
  34 +
  35 + /**
  36 + * Setup test data for all cases
  37 + */
  38 +
  39 + public function setUp() {
  40 + $this->loadFixtures($this->classes);
  41 + }
  42 +
  43 + /**
  44 + * Clear test data for all cases
  45 + */
  46 + public function tearDown() {
  47 +
  48 + }
  49 +}
0 50 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Tests/Controller/AgenteControllerTest.php 0 → 100644
... ... @@ -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 38 \ No newline at end of file
... ...
src/Cacic/WSBundle/Controller/NeoController.php 0 → 100644
... ... @@ -0,0 +1,892 @@
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: gabi
  5 + * Date: 25/07/14
  6 + * Time: 12:24
  7 + */
  8 +
  9 +namespace Cacic\WSBundle\Controller;
  10 +
  11 +use Cacic\CommonBundle\Entity\ClassProperty;
  12 +use Cacic\CommonBundle\Entity\PropriedadeSoftwareRepository;
  13 +use Proxies\__CG__\Cacic\CommonBundle\Entity\Software;
  14 +use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  15 +use Symfony\Component\BrowserKit\Response;
  16 +use Symfony\Component\HttpFoundation\Request;
  17 +use Symfony\Component\HttpFoundation\JsonResponse;
  18 +use Symfony\Component\HttpFoundation\Session\Session;
  19 +use Symfony\Component\Serializer\Serializer;
  20 +use Symfony\Component\Serializer\Encoder\JsonEncoder;
  21 +use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
  22 +use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
  23 +
  24 +use Cacic\CommonBundle\Entity\Computador;
  25 +use Cacic\CommonBundle\Entity\LogAcesso;
  26 +use Cacic\CommonBundle\Entity\So;
  27 +use Cacic\CommonBundle\Entity\ComputadorColeta;
  28 +use Cacic\CommonBundle\Entity\ComputadorColetaHistorico;
  29 +use Cacic\CommonBundle\Entity\PropriedadeSoftware;
  30 +
  31 +
  32 +class NeoController extends Controller {
  33 +
  34 +
  35 + public function __construct($maxIdleTime = 1800)
  36 + {
  37 + $this->maxIdleTime = $maxIdleTime;
  38 + }
  39 +
  40 + /**
  41 + * Método que retorna 200 em requisição na raiz
  42 + */
  43 + public function indexAction(Request $request)
  44 + {
  45 + $logger = $this->get('logger');
  46 +
  47 + $response = new JsonResponse();
  48 +
  49 +
  50 + if ( $request->isMethod('POST') ) {
  51 + $response->setStatusCode(200);
  52 + } else {
  53 + $response->setStatusCode(403);
  54 + }
  55 +
  56 + return $response;
  57 + }
  58 +
  59 + /**
  60 + * Faz login do agente
  61 + */
  62 + public function loginAction(Request $request)
  63 + {
  64 + $logger = $this->get('logger');
  65 + $em = $this->getDoctrine()->getManager();
  66 + $data = $request->getContent();
  67 +
  68 + $session = $request->getSession();
  69 + $session->start();
  70 +
  71 + $chavecrip = '123456';
  72 +
  73 + $usuario = $this->get('security.context')->getToken()->getUser();
  74 + $logger->debug("Usuario encontrado: ".$usuario->getUserName());
  75 +
  76 + $auth = new JsonResponse();
  77 + $auth->setContent(json_encode(array(
  78 + 'session' => $session->getId(),
  79 + 'chavecrip' => $usuario->getApiKey()
  80 + )));
  81 +
  82 + return $auth;
  83 + }
  84 +
  85 + /**
  86 + * Controller só para testar a validação da sessão
  87 + */
  88 +
  89 + public function checkSessionAction(Request $request)
  90 + {
  91 + $logger = $this->get('logger');
  92 + $data = $request->getContent();
  93 + $response = new JsonResponse();
  94 + $session = $request->getSession();
  95 + if (empty($session)) {
  96 + $response->setStatusCode('401');
  97 + }
  98 + $session_valid = $this->checkSession($session);
  99 + if ($session_valid) {
  100 + $response->setStatusCode('200');
  101 + } else {
  102 + $response->setStatusCode('401');
  103 + }
  104 +
  105 + return $response;
  106 + }
  107 +
  108 + /*
  109 + Insere o computador se não existir
  110 + */
  111 + public function getTestAction(Request $request)
  112 + {
  113 + //1 - Verificar se computador existe
  114 + $logger = $this->get('logger');
  115 + $status = $request->getContent();
  116 + $em = $this->getDoctrine()->getManager();
  117 +
  118 + $logger->debug("JSON getTest:\n".$status);
  119 +
  120 + $dados = json_decode($status, true);
  121 +
  122 + if (empty($dados)) {
  123 + $logger->error("JSON INVÁLIDO!!!!!!!!!!!!!!!!!!! Erro no getTest");
  124 + // Retorna erro se o JSON for inválido
  125 + $error_msg = '{
  126 + "message": "JSON Inválido",
  127 + "codigo": 1
  128 + }';
  129 +
  130 +
  131 + $response = new JsonResponse();
  132 + $response->setStatusCode('500');
  133 + $response->setContent($error_msg);
  134 + return $response;
  135 + }
  136 +
  137 + $logger->debug("JSON get Test status \n".print_r(json_decode($status, true), true));
  138 +
  139 + // Identifica computador
  140 + $computador = $this->getComputador($dados, $request);
  141 +
  142 + if (empty($computador)) {
  143 + $logger->error("Erro na identificação do computador. Retorna mensagem de erro");
  144 +
  145 + $error_msg = '{
  146 + "message": "Computador não identificado",
  147 + "codigo": 2
  148 + }';
  149 +
  150 +
  151 + $response = new JsonResponse();
  152 + $response->setStatusCode('500');
  153 + $response->setContent($error_msg);
  154 + return $response;
  155 + }
  156 +
  157 +
  158 + // 3 - Grava no log de acesso
  159 + //Só adiciona se o último registro foi em data diferente da de hoje
  160 +
  161 + $data_acesso = new \DateTime();
  162 + $hoje = $data_acesso->format('Y-m-d');
  163 +
  164 + $ultimo_acesso = $em->getRepository('CacicCommonBundle:LogAcesso')->ultimoAcesso( $computador->getIdComputador() );
  165 + if (empty($ultimo_acesso)) {
  166 + // Se for o primeiro registro grava o acesso do computador
  167 + $logger->debug("Último acesso não encontrado. Registrando acesso para o computador $computador em $hoje");
  168 +
  169 + $log_acesso = new LogAcesso();
  170 + $log_acesso->setIdComputador($computador);
  171 + $log_acesso->setData($data_acesso);
  172 +
  173 + // Grava o log
  174 + $em->persist($log_acesso);
  175 +
  176 +
  177 + } else {
  178 + $dt_ultimo_acesso = $ultimo_acesso->getData()->format('Y-m-d');
  179 +
  180 + // Adiciona se a data de útimo acesso for diferente do dia de hoje
  181 + if ($hoje != $dt_ultimo_acesso) {
  182 + $logger->debug("Inserindo novo registro de acesso para o computador $computador em $hoje");
  183 +
  184 + $log_acesso = new LogAcesso();
  185 + $log_acesso->setIdComputador($computador);
  186 + $log_acesso->setData($data_acesso);
  187 +
  188 + // Grava o log
  189 + $em->persist($log_acesso);
  190 +
  191 + }
  192 + }
  193 +
  194 + # TODO: Grava log de acessos de usuario do computador
  195 +
  196 + $em->flush();
  197 +
  198 + $response = new JsonResponse();
  199 + $response->setStatusCode('200');
  200 + return $response;
  201 + }
  202 +
  203 + /*
  204 + * ConfigTeste
  205 + */
  206 + public function configAction(Request $request)
  207 + {
  208 + $logger = $this->get('logger');
  209 + $status = $request->getContent();
  210 + $em = $this->getDoctrine()->getManager();
  211 + $dados = json_decode($status, true);
  212 +
  213 + if (empty($dados)) {
  214 + $logger->error("JSON INVÁLIDO!!!!!!!!!!!!!!!!!!! Erro no getConfig");
  215 + // Retorna erro se o JSON for inválido
  216 + $error_msg = '{
  217 + "message": "JSON Inválido",
  218 + "codigo": 1
  219 + }';
  220 +
  221 +
  222 + $response = new JsonResponse();
  223 + $response->setStatusCode('500');
  224 + $response->setContent($error_msg);
  225 + return $response;
  226 + }
  227 +
  228 + $computador = $this->getComputador($dados, $request);
  229 +
  230 + if (empty($computador)) {
  231 + // Se não identificar o computador, manda para o getUpdate
  232 + $logger->error("Computador não identificado no getConfig. Necessário executar getUpdate");
  233 +
  234 + $error_msg = '{
  235 + "message": "Computador não identificado",
  236 + "codigo": 2
  237 + }';
  238 +
  239 +
  240 + $response = new JsonResponse();
  241 + $response->setStatusCode('500');
  242 + $response->setContent($error_msg);
  243 + return $response;
  244 + }
  245 +
  246 + // 0 - Array de saída
  247 + $saida['agentcomputer'] = "";
  248 +
  249 +
  250 + // 1 - Ações para o computador
  251 + $acoes = $em->getRepository('CacicCommonBundle:Acao')->listaAcaoComputador(
  252 + $computador->getIdRede()->getIdRede(),
  253 + $computador->getIdSo()->getIdSo(),
  254 + $computador->getTeNodeAddress()
  255 + );
  256 + $logger->debug("Ações encontradas \n".print_r($acoes, true));
  257 + $cols = array();
  258 + foreach ($acoes as $elm) {
  259 + // Adiciona ações na saída
  260 + if (empty($elm['idAcao'])) {
  261 + $saida['agentcomputer']['actions'][$elm['acaoExecao']] = true;
  262 + }
  263 + $saida['agentcomputer']['actions'][$elm['idAcao']] = true;
  264 + }
  265 +
  266 + //$logger->debug("1111111111111111111111111111111 \n".print_r($saida, true));
  267 +
  268 + // 2 - Adiciona módulos da subrede
  269 + $modulos = $em->getRepository('CacicCommonBundle:RedeVersaoModulo')->findBy(array('idRede' => $computador->getIdRede()));
  270 + //$logger->debug("Módulos encontrados \n". print_r($modulos, true));
  271 + $mods = array();
  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 + }
  280 + // Adiciona módulos e hashes
  281 + array_push($mods[$tipo], array(
  282 + 'nome' => $elm->getNmModulo(),
  283 + 'hash' => $elm->getTeHash()
  284 + ));
  285 + }
  286 + $saida['agentcomputer']['modulos'] = $mods;
  287 + //$logger->debug("2222222222222222222222222222222222222 \n".print_r($saida, true));
  288 +
  289 + // 3 - Adiciona classes WMI
  290 + $class = $em->getRepository('CacicCommonBundle:Classe')->findAll();
  291 + $classes = array();
  292 + foreach($class as $elm) {
  293 + // Adiciona classes WMI
  294 + array_push($classes, $elm->getNmClassName());
  295 + }
  296 + $saida['agentcomputer']['classes'] = $classes;
  297 + //$logger->debug("33333333333333333333333333333333333333333 \n".print_r($saida, true));
  298 +
  299 +
  300 + // 4 - Configurações genéricas
  301 + $saida['agentcomputer']['applicationUrl'] = $computador->getIdRede()->getTeServCacic();
  302 + $saida['agentcomputer']['metodoDownload'] = array(
  303 + "tipo" => $computador->getIdRede()->getDownloadMethod(),
  304 + "url" => $computador->getIdRede()->getTeServUpdates(),
  305 + "path" => $computador->getIdRede()->getTePathServUpdates(),
  306 + "usuario" => $computador->getIdRede()->getNmUsuarioLoginServUpdates(),
  307 + "senha" => $computador->getIdRede()->getTeSenhaLoginServUpdates()
  308 + );
  309 + //$logger->debug("4444444444444444444444444444444444444444 \n".print_r($saida, true));
  310 +
  311 + // 5 - Configurações do local
  312 + $configuracao_local = $computador->getIdRede()->getIdLocal()->getConfiguracoes();
  313 + foreach ($configuracao_local as $configuracao) {
  314 + //$logger->debug("5555555555555555555555555555555555555 ".$configuracao->getIdConfiguracao()->getIdConfiguracao() . " | " . $configuracao->getVlConfiguracao());
  315 + $saida['agentcomputer']['configuracoes'][$configuracao->getIdConfiguracao()->getIdConfiguracao()] = $configuracao->getVlConfiguracao();
  316 + }
  317 +
  318 + $logger->debug("Dados das configurações \n". print_r($saida, true));
  319 + $resposta = json_encode($saida);
  320 +
  321 + $response = new JsonResponse();
  322 + $response->setContent($resposta);
  323 +
  324 + $response->setStatusCode('200');
  325 + return $response;
  326 + }
  327 +
  328 +
  329 + /**
  330 + * Função para validar a sessão
  331 + *
  332 + * @param Session $session
  333 + * @return bool
  334 + */
  335 + public function checkSession(Session $session) {
  336 + $logger = $this->get('logger');
  337 + $session->getMetadataBag()->getCreated();
  338 + $session->getMetadataBag()->getLastUsed();
  339 +
  340 + if(time() - $session->getMetadataBag()->getLastUsed() > $this->maxIdleTime) {
  341 + $session->invalidate();
  342 + $logger->error("Sessão inválida:\n".$session->getId());
  343 + //throw new SessionExpired(); // direciona para a página de sessão expirada
  344 +
  345 + return false;
  346 + }
  347 + else{
  348 + return true;
  349 + }
  350 + }
  351 +
  352 +
  353 + /**
  354 + * Função para identificar o computador
  355 + *
  356 + * @param $dados JSON da requisitção
  357 + * @param Request $request
  358 + * @return Computador|null|object Computador identificado
  359 + */
  360 +
  361 + public function getComputador($dados, Request $request) {
  362 + $logger = $this->get('logger');
  363 + $em = $this->getDoctrine()->getManager();
  364 +
  365 + $so_json = $dados['computador']['operatingSystem'];
  366 + $rede_json = $dados['computador']['networkDevices'];
  367 + $rede1 = $rede_json[0];
  368 + $te_node_address = $rede1['mac'];
  369 + $ip_computador = $rede1['ipv4'];
  370 + $netmask = $rede1['netmask_ipv4'];
  371 + $usuario = $dados['computador']['usuario'];
  372 + $nmComputador = $dados['computador']['nmComputador'];
  373 + $versaoAgente = $dados['computador']['versaoAgente'];
  374 +
  375 +
  376 + // TESTES: Se IP for vazio, tenta pegar da conexão
  377 + if (empty($ip_computador)) {
  378 + $ip_computador = $request->getClientIp();
  379 + }
  380 +
  381 + // Pega rede e SO
  382 + $rede = $em->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask );
  383 + $so = $em->getRepository('CacicCommonBundle:So')->createIfNotExist($so_json['nomeOs']);
  384 +
  385 + // Regra: MAC e SO são únicos e não podem ser nulos
  386 + // Se SO ou MAC forem vazios, tenta atualizar forçadamente
  387 + if (empty($te_node_address) || empty($so)) {
  388 + $logger->error("Erro na operação de getConfig. IP = $ip_computador Máscara = $netmask. MAC = $te_node_address. SO =" . $request->get( 'te_so' ));
  389 +
  390 + return null;
  391 + }
  392 +
  393 + $computador = $em->getRepository('CacicCommonBundle:Computador')->findOneBy(array(
  394 + 'teNodeAddress'=> $te_node_address,
  395 + 'idSo' => $so
  396 + ));
  397 + //$logger->debug("$so".print_r($so, true));
  398 + //$logger->debug("$computador".print_r($computador, true));
  399 + //$logger->debug("111111111111111111111111111111111111111111111111");
  400 +
  401 + $data = new \DateTime('NOW'); //armazena data Atual
  402 +
  403 + //2 - Insere computador que não existe
  404 + if( empty ( $computador ) )
  405 + {
  406 + $logger->debug("Inserindo novo computador para MAC = $te_node_address e SO = ".$so_json['nomeOs']);
  407 +
  408 + $computador = new Computador();
  409 +
  410 + $computador->setTeNodeAddress( $te_node_address );
  411 + $computador->setIdSo( $so );
  412 + $computador->setIdRede( $rede );
  413 + $computador->setDtHrInclusao( $data);
  414 + $computador->setTeIpComputador($ip_computador);
  415 + $computador->setDtHrUltAcesso($data);
  416 + $computador->setTeUltimoLogin($usuario);
  417 + $computador->setTeVersaoCacic($versaoAgente);
  418 + $computador->setNmComputador($nmComputador);
  419 +
  420 + $em->persist( $computador );
  421 +
  422 + }
  423 +
  424 + // 2.1 - Se existir, atualiza hora de inclusão
  425 + else
  426 + {
  427 + $logger->debug("Atualizando hora de último acesso do computador para MAC = $te_node_address e SO = ".$so_json['nomeOs']);
  428 +
  429 + $computador->setDtHrUltAcesso($data);
  430 + $computador->setTeIpComputador($ip_computador);
  431 + $computador->setTeUltimoLogin($usuario);
  432 + $computador->setTeVersaoCacic($versaoAgente);
  433 + $computador->setNmComputador($nmComputador);
  434 +
  435 + //Atualiza hora de inclusão
  436 + $em->persist($computador);
  437 +
  438 + }
  439 +
  440 + return $computador;
  441 +
  442 + }
  443 +
  444 + public function getComputadorSemMac($dados, Request $request) {
  445 + $logger = $this->get('logger');
  446 + $em = $this->getDoctrine()->getManager();
  447 +
  448 + $so_json = $dados['computador']['operatingSystem'];
  449 + $rede_json = $dados['computador']['networkDevices'];
  450 + $rede1 = $rede_json[0];
  451 + $ip_computador = $rede1['ipv4'];
  452 + $netmask = $rede1['netmask_ipv4'];
  453 +
  454 + // TESTES: Se IP for vazio, tenta pegar da conexão
  455 + if (empty($ip_computador)) {
  456 + $ip_computador = $request->getClientIp();
  457 + }
  458 +
  459 + // Pega rede e SO
  460 + $so = $em->getRepository('CacicCommonBundle:So')->createIfNotExist($so_json['nomeOs']);
  461 +
  462 + // Regra: MAC e SO são únicos e não podem ser nulos
  463 + // Se SO ou MAC forem vazios, tenta atualizar forçadamente
  464 + $computador = $em->getRepository('CacicCommonBundle:Computador')->semMac($ip_computador, $so);
  465 + //$logger->debug("$so".print_r($so, true));
  466 + //$logger->debug("$computador".print_r($computador, true));
  467 + //$logger->debug("111111111111111111111111111111111111111111111111");
  468 +
  469 + return $computador;
  470 +
  471 + }
  472 +
  473 + public function updateAction(Request $request) {
  474 + $logger = $this->get('logger');
  475 + $status = $request->getContent();
  476 + $em = $this->getDoctrine()->getManager();
  477 + $dados = json_decode($status, true);
  478 +
  479 + if (empty($dados)) {
  480 + $logger->error("JSON INVÁLIDO!!!!!!!!!!!!!!!!!!! Erro no getUpdate");
  481 + // Retorna erro se o JSON for inválido
  482 + $error_msg = '{
  483 + "message": "JSON Inválido",
  484 + "codigo": 1
  485 + }';
  486 +
  487 +
  488 + $response = new JsonResponse();
  489 + $response->setStatusCode('500');
  490 + $response->setContent($error_msg);
  491 + return $response;
  492 + }
  493 +
  494 + $computador = $this->getComputadorSemMac($dados, $request);
  495 +
  496 + if (empty($computador)){
  497 + // Só vai retornar erro se não tiver nenhum computador cadastrado
  498 + $logger->error("Nenhum computador cadastrado!!! Erro no getUpdate");
  499 + // Retorna erro se o JSON for inválido
  500 + $error_msg = '{
  501 + "message": "Ainda não há computadores cadastrados",
  502 + "codigo": 3
  503 + }';
  504 +
  505 +
  506 + $response = new JsonResponse();
  507 + $response->setStatusCode('500');
  508 + $response->setContent($error_msg);
  509 + return $response;
  510 + }
  511 +
  512 + // 0 - Array de saída
  513 + $saida['agentcomputer'] = "";
  514 +
  515 +
  516 + // 1 - Ações para o computador
  517 + $acoes = $em->getRepository('CacicCommonBundle:Acao')->listaAcaoComputador(
  518 + $computador->getIdRede()->getIdRede(),
  519 + $computador->getIdSo()->getIdSo(),
  520 + $computador->getTeNodeAddress()
  521 + );
  522 + $logger->debug("Ações encontradas \n".print_r($acoes, true));
  523 + $cols = array();
  524 + foreach ($acoes as $elm) {
  525 + // Adiciona ações na saída
  526 + if (empty($elm['idAcao'])) {
  527 + $saida['agentcomputer']['actions'][$elm['acaoExecao']] = true;
  528 + }
  529 + $saida['agentcomputer']['actions'][$elm['idAcao']] = true;
  530 + }
  531 +
  532 + //$logger->debug("1111111111111111111111111111111 \n".print_r($saida, true));
  533 +
  534 + // 2 - Adiciona módulos da subrede
  535 + $modulos = $em->getRepository('CacicCommonBundle:RedeVersaoModulo')->findBy(array('idRede' => $computador->getIdRede()));
  536 + //$logger->debug("Módulos encontrados \n". print_r($modulos, true));
  537 + $mods = array();
  538 + foreach($modulos as $elm) {
  539 + // Adiciona módulos e hashes
  540 + array_push($mods, array(
  541 + 'nome' => $elm->getNmModulo(),
  542 + 'hash' => $elm->getTeHash()
  543 + ));
  544 + }
  545 + $saida['agentcomputer']['modulos'] = $mods;
  546 + //$logger->debug("2222222222222222222222222222222222222 \n".print_r($saida, true));
  547 +
  548 + // 3 - Adiciona classes WMI
  549 + $class = $em->getRepository('CacicCommonBundle:Classe')->findAll();
  550 + $classes = array();
  551 + foreach($class as $elm) {
  552 + // Adiciona classes WMI
  553 + array_push($classes, $elm->getNmClassName());
  554 + }
  555 + $saida['agentcomputer']['classes'] = $classes;
  556 + //$logger->debug("33333333333333333333333333333333333333333 \n".print_r($saida, true));
  557 +
  558 +
  559 + // 4 - Configurações genéricas
  560 + $saida['agentcomputer']['applicationUrl'] = $computador->getIdRede()->getTeServCacic();
  561 + $saida['agentcomputer']['metodoDownload'] = array(
  562 + "tipo" => "ftp",
  563 + "url" => $computador->getIdRede()->getTeServUpdates(),
  564 + "path" => $computador->getIdRede()->getTePathServUpdates(),
  565 + "usuario" => $computador->getIdRede()->getNmUsuarioLoginServUpdates(),
  566 + "senha" => $computador->getIdRede()->getTeSenhaLoginServUpdates()
  567 + );
  568 + //$logger->debug("4444444444444444444444444444444444444444 \n".print_r($saida, true));
  569 +
  570 + // 5 - Configurações do local
  571 + $configuracao_local = $computador->getIdRede()->getIdLocal()->getConfiguracoes();
  572 + foreach ($configuracao_local as $configuracao) {
  573 + //$logger->debug("5555555555555555555555555555555555555 ".$configuracao->getIdConfiguracao()->getIdConfiguracao() . " | " . $configuracao->getVlConfiguracao());
  574 + $saida['agentcomputer']['configuracoes'][$configuracao->getIdConfiguracao()->getIdConfiguracao()] = $configuracao->getVlConfiguracao();
  575 + }
  576 +
  577 + $logger->debug("Dados das configurações \n". print_r($saida, true));
  578 + $resposta = json_encode($saida);
  579 +
  580 + $response = new JsonResponse();
  581 + $response->setContent($resposta);
  582 +
  583 + $response->setStatusCode('200');
  584 + return $response;
  585 + }
  586 +
  587 + public function coletaAction(Request $request) {
  588 + $logger = $this->get('logger');
  589 + $status = $request->getContent();
  590 + $em = $this->getDoctrine()->getManager();
  591 + $dados = json_decode($status, true);
  592 +
  593 + if (empty($dados)) {
  594 + $logger->error("JSON INVÁLIDO!!!!!!!!!!!!!!!!!!! Erro na COLETA");
  595 + // Retorna erro se o JSON for inválido
  596 + $error_msg = '{
  597 + "message": "JSON Inválido",
  598 + "codigo": 1
  599 + }';
  600 +
  601 +
  602 + $response = new JsonResponse();
  603 + $response->setStatusCode('500');
  604 + $response->setContent($error_msg);
  605 + return $response;
  606 + }
  607 +
  608 + $computador = $this->getComputador($dados, $request);
  609 +
  610 + if (empty($computador)) {
  611 + // Se não identificar o computador, manda para o getUpdate
  612 + $logger->error("Computador não identificado no getConfig. Necessário executar getUpdate");
  613 +
  614 + $error_msg = '{
  615 + "message": "Computador não identificado",
  616 + "codigo": 2
  617 + }';
  618 +
  619 +
  620 + $response = new JsonResponse();
  621 + $response->setStatusCode('500');
  622 + $response->setContent($error_msg);
  623 + return $response;
  624 + }
  625 +
  626 + $result1 = $this->setHardware($dados['hardware'], $computador);
  627 + $result2 = $this->setSoftware($dados['software'], $computador);
  628 +
  629 + $response = new JsonResponse();
  630 + if ($result1 && $result2) {
  631 + $response->setStatusCode('200');
  632 + } else {
  633 + $response->setStatusCode('500');
  634 + }
  635 +
  636 + return $response;
  637 +
  638 + }
  639 +
  640 + /**
  641 + * Classe que persiste a coleta de hardware
  642 + *
  643 + * @param $hardware
  644 + * @param $computador
  645 + */
  646 +
  647 + public function setHardware($hardware, $computador) {
  648 + $logger = $this->get('logger');
  649 + $em = $this->getDoctrine()->getManager();
  650 +
  651 + // Pega todas as propriedades de coleta
  652 + foreach ($hardware as $classe => $valor) {
  653 + $logger->debug("COLETA: Gravando dados da classe $classe");
  654 + $this->setClasse($classe, $valor, $computador);
  655 + }
  656 +
  657 + return true;
  658 + }
  659 +
  660 + /**
  661 + * Classe que grava todas as propriedades da classe de coleta
  662 + *
  663 + * @param $classe
  664 + * @param $computador
  665 + */
  666 + public function setClasse($classe, $valor, $computador) {
  667 + $logger = $this->get('logger');
  668 + $em = $this->getDoctrine()->getManager();
  669 +
  670 + #$classObject = $em->getRepository('CacicCommonBundle:Classe')->findOneBy( array(
  671 + # 'nmClassName'=> $classe
  672 + #));
  673 +
  674 + $_dql = "SELECT classe
  675 + FROM CacicCommonBundle:Classe classe
  676 + WHERE LOWER(classe.nmClassName) = LOWER(:classe)";
  677 +
  678 + $classObject = $em->createQuery( $_dql )->setParameter('classe', $classe)->getOneOrNullResult();
  679 +
  680 + if (empty($classObject)) {
  681 + $logger->error("COLETA: Classe não cadastrada: $classe");
  682 + return;
  683 + }
  684 +
  685 + // Trata classe multivalorada
  686 + if (!empty($valor[0])) {
  687 + // Nesse caso a classe é multivalorada. Considero somente a primeira ocorrência
  688 + $logger->debug("COLETA: Classe $classe multivalorada. Retornando somente primeiro elemento.");
  689 + $valor = $valor[0];
  690 + }
  691 +
  692 + foreach (array_keys($valor) as $propriedade) {
  693 + if (is_array($valor[$propriedade])) {
  694 + $logger->error("COLETA: Atributo $propriedade multivalorado não implementado na coleta");
  695 + //$logger->debug("1111111111111111111111111111111111111111 ".print_r($valor, true));
  696 + $valor[$propriedade] = $valor[$propriedade][0];
  697 + //continue;
  698 + }
  699 + $logger->debug("COLETA: Gravando dados da propriedade $propriedade com o valor ".$valor[$propriedade]);
  700 +
  701 + try {
  702 +
  703 + // Pega o objeto para gravar
  704 + $classProperty = $em->getRepository('CacicCommonBundle:ClassProperty')->findOneBy( array(
  705 + 'nmPropertyName'=> $propriedade,
  706 + 'idClass' => $classObject
  707 + ));
  708 +
  709 + if (empty($classProperty)) {
  710 + $logger->info("COLETA: Cadastrando propriedade não encontrada $propriedade");
  711 +
  712 + $classProperty = new ClassProperty();
  713 + $classProperty->setIdClass($classObject);
  714 + $classProperty->setNmPropertyName($propriedade);
  715 + $classProperty->setTePropertyDescription("Propriedade criada automaticamente: $propriedade");
  716 +
  717 + $em->persist($classProperty);
  718 + }
  719 +
  720 + // Garante unicidade das informações de coleta
  721 + $computadorColeta = $em->getRepository('CacicCommonBundle:ComputadorColeta')->findOneBy(array(
  722 + 'computador' => $computador,
  723 + 'classProperty' => $classProperty
  724 + ));
  725 + if (empty($computadorColeta)) {
  726 + $computadorColeta = new ComputadorColeta();
  727 + }
  728 +
  729 + // Armazena no banco o objeto
  730 + $computadorColeta->setComputador( $computador );
  731 + $computadorColeta->setClassProperty($classProperty);
  732 + $computadorColeta->setTeClassPropertyValue($valor[$propriedade]);
  733 + $computadorColeta->setIdClass($classObject);
  734 + $computadorColeta->setDtHrInclusao( new \DateTime() );
  735 +
  736 + // Mando salvar os dados do computador
  737 + $em->persist( $computadorColeta );
  738 +
  739 + // Persistencia de Historico
  740 + $computadorColetaHistorico = new ComputadorColetaHistorico();
  741 + $computadorColetaHistorico->setComputadorColeta( $computadorColeta );
  742 + $computadorColetaHistorico->setComputador( $computador );
  743 + $computadorColetaHistorico->setClassProperty( $classProperty);
  744 + $computadorColetaHistorico->setTeClassPropertyValue($valor[$propriedade]);
  745 + $computadorColetaHistorico->setDtHrInclusao( new \DateTime() );
  746 + $em->persist( $computadorColetaHistorico );
  747 +
  748 + // Grava tudo da propriedade
  749 + $em->flush();
  750 + } catch(\Doctrine\ORM\ORMException $e){
  751 + $logger->error("COLETA: Erro na inserçao de dados da propriedade $propriedade. \n$e");
  752 + }
  753 +
  754 + }
  755 + }
  756 +
  757 + public function setSoftware($software, $computador) {
  758 + $logger = $this->get('logger');
  759 + $em = $this->getDoctrine()->getManager();
  760 +
  761 + try {
  762 + $classObject = $em->getRepository('CacicCommonBundle:Classe')->findOneBy( array(
  763 + 'nmClassName'=> 'SoftwareList'
  764 + ));
  765 + }
  766 + catch(\Doctrine\ORM\NoResultException $e) {
  767 + $logger->error("COLETA: Classe SoftwareList não cadastrada \n$e");
  768 + return false;
  769 + }
  770 +
  771 + // Pega todas as propriedades de coleta
  772 + $i = 0;
  773 + foreach ($software as $classe => $valor) {
  774 + $logger->debug("COLETA: Gravando dados do software $classe");
  775 + $this->setSoftwareElement($classe, $valor, $computador, $classObject);
  776 + $i = $i + 1;
  777 + }
  778 + $logger->debug("COLETA: Coleta de software finalizada. Total de softwares coletados: $i");
  779 +
  780 + return true;
  781 + }
  782 +
  783 + public function setSoftwareElement($software, $valor, $computador, $classObject) {
  784 + $logger = $this->get('logger');
  785 + $em = $this->getDoctrine()->getManager();
  786 +
  787 + if (empty($software)) {
  788 + $logger->error("COLETA: Erro na coleta de software. Elemento nulo $software");
  789 + return false;
  790 + }
  791 +
  792 + try {
  793 +
  794 + // Pega o objeto para gravar
  795 + $propSoftware = $em->getRepository('CacicCommonBundle:PropriedadeSoftware')->softwareByName($software);
  796 + if (!empty($propSoftware)) {
  797 + $classProperty = $propSoftware->getClassProperty();
  798 + $softwareObject = $propSoftware->getSoftware();
  799 +
  800 + // Encontra coleta já feita para o Computador
  801 + $computadorColeta = $em->getRepository('CacicCommonBundle:ComputadorColeta')->findOneBy(array(
  802 + 'computador' => $computador,
  803 + 'classProperty' => $classProperty
  804 + ));
  805 + if(empty($computadorColeta)) {
  806 + $logger->error("COLETA: Erro na identificação da coleta. O software está cadastrado mas não há ocorrência de coletas no computador");
  807 + $computadorColeta = new ComputadorColeta();
  808 + $computador->addHardware( $computadorColeta );
  809 + }
  810 + } else {
  811 + $logger->info("COLETA: Cadastrando software não encontrado $software");
  812 +
  813 + $computadorColeta = new ComputadorColeta();
  814 + $propSoftware = new PropriedadeSoftware();
  815 +
  816 + // Verifica se software ja esta cadastrado
  817 + $softwareObject = $em->getRepository('CacicCommonBundle:Software')->findOneBy(array(
  818 + 'nmSoftware' => $software
  819 + ));
  820 + if (empty($softwareObject)) {
  821 + // Se nao existir, cria
  822 + $softwareObject = new Software();
  823 + }
  824 +
  825 + $classProperty = new ClassProperty();
  826 + }
  827 +
  828 + // Atualiza valores
  829 + $computadorColeta->setComputador( $computador );
  830 +
  831 + $classProperty->setIdClass($classObject);
  832 + $classProperty->setNmPropertyName($software);
  833 + $classProperty->setTePropertyDescription("Propriedade criada automaticamente: $software");
  834 +
  835 + $propSoftware->setComputador($computador);
  836 + $propSoftware->setClassProperty($classProperty);
  837 + $propSoftware->setSoftware($softwareObject);
  838 +
  839 + // Atualiza valores do Software
  840 + $softwareObject->setNmSoftware($software);
  841 + if (array_key_exists('description', $valor)) {
  842 + $softwareObject->setTeDescricaoSoftware($valor['description']);
  843 + $propSoftware->setDisplayName($valor['description']);
  844 + }
  845 + if (array_key_exists('name', $valor)) {
  846 + $softwareObject->setNmSoftware($valor['name']);
  847 + $classProperty->setNmPropertyName($valor['name']);
  848 + }
  849 + if (array_key_exists('url', $valor)) {
  850 + $propSoftware->setUrlInfoAbout($valor['url']);
  851 + }
  852 + if (array_key_exists('version', $valor)) {
  853 + $propSoftware->setDisplayVersion($valor['version']);
  854 + }
  855 + if (array_key_exists('publisher', $valor)) {
  856 + $propSoftware->setPublisher($valor['publisher']);
  857 + }
  858 +
  859 + $em->persist($classProperty);
  860 + $em->persist($propSoftware);
  861 + $em->persist($softwareObject);
  862 +
  863 +
  864 + // Armazena no banco o objeto
  865 + $computadorColeta->setClassProperty($classProperty);
  866 + $computadorColeta->setTeClassPropertyValue($software);
  867 + $computadorColeta->setIdClass($classObject);
  868 + $computadorColeta->setDtHrInclusao( new \DateTime() );
  869 +
  870 + // Mando salvar os dados do computador
  871 + $computador->addHardware($computadorColeta);
  872 + $em->persist( $computadorColeta );
  873 + $em->persist( $computador );
  874 +
  875 + // Persistencia de Historico
  876 + $computadorColetaHistorico = new ComputadorColetaHistorico();
  877 + $computadorColetaHistorico->setComputadorColeta( $computadorColeta );
  878 + $computadorColetaHistorico->setComputador( $computador );
  879 + $computadorColetaHistorico->setClassProperty( $classProperty);
  880 + $computadorColetaHistorico->setTeClassPropertyValue($software);
  881 + $computadorColetaHistorico->setDtHrInclusao( new \DateTime() );
  882 + $em->persist( $computadorColetaHistorico );
  883 +
  884 + // Grava tudo da propriedade
  885 + $em->flush();
  886 + } catch(\Doctrine\ORM\ORMException $e){
  887 + $logger->error("COLETA: Erro na inserçao de dados do software $software. \n$e");
  888 + }
  889 +
  890 + }
  891 +
  892 +}
... ...
src/Cacic/WSBundle/Resources/config/routing.yml
... ... @@ -51,3 +51,36 @@ cacic_ws_srcacic_set_session:
51 51 cacic_ws_srcacic_ayth_client:
52 52 pattern: /srcacic/auth/client
53 53 defaults: { _controller: CacicWSBundle:Coleta:srCacicAuthClient }
  54 +
  55 +cacic_neo_home:
  56 + pattern: /neo
  57 + defaults: { _controller: CacicWSBundle:Neo:index }
  58 + schemes: [https]
  59 +
  60 +cacic_neo_home_login:
  61 + pattern: /neo/getLogin
  62 + defaults: { _controller: CacicWSBundle:Neo:login }
  63 + schemes: [https]
  64 +
  65 +cacic_neo_home_checksession:
  66 + pattern: /neo/checkSession
  67 + defaults: { _controller: CacicWSBundle:Neo:checkSession }
  68 + #schemes: [https]
  69 +
  70 +cacic_neo_home_gettest:
  71 + pattern: /neo/getTest
  72 + defaults: { _controller: CacicWSBundle:Neo:getTest }
  73 + #schemes: [https]
  74 +
  75 +cacic_neo_home_config:
  76 + pattern: /neo/config
  77 + defaults: { _controller: CacicWSBundle:Neo:config }
  78 + #schemes: [https]
  79 +
  80 +cacic_neo_home_update:
  81 + pattern: /neo/update
  82 + defaults: { _controller: CacicWSBundle:Neo:update }
  83 +
  84 +cacic_neo_coleta:
  85 + pattern: /neo/coleta
  86 + defaults: { _controller: CacicWSBundle:Neo:coleta }
54 87 \ No newline at end of file
... ...
src/Cacic/WSBundle/Resources/config/services.yml
  1 +parameters:
  2 + webservice_user_provider.class: Cacic\WSBundle\Security\User\WebserviceUserProvider
  3 +
1 4 services:
2 5 cacic.twig.old_cacic_extension:
3 6 class: Cacic\WSBundle\Twig\OldCacicExtension
... ... @@ -6,4 +9,8 @@ services:
6 9  
7 10 cacic.commonbundle.helper.old_cacic_helper:
8 11 class: Cacic\CommonBundle\Helper\OldCacicHelper
9   - arguments: [@kernel]
10 12 \ No newline at end of file
  13 + arguments: [@kernel]
  14 +
  15 + webservice_user_provider:
  16 + class: "%webservice_user_provider.class%"
  17 + arguments: [@service_container]
11 18 \ No newline at end of file
... ...
src/Cacic/WSBundle/Security/ApiKeyAuthenticator.php 0 → 100644
... ... @@ -0,0 +1,88 @@
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: eduardo
  5 + * Date: 23/09/14
  6 + * Time: 23:03
  7 + */
  8 +
  9 +namespace Cacic\WSBundle\Security;
  10 +
  11 +use Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface;
  12 +use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  13 +use Symfony\Component\Security\Core\Exception\AuthenticationException;
  14 +use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
  15 +use Symfony\Component\HttpFoundation\Request;
  16 +use Symfony\Component\Security\Core\User\UserProviderInterface;
  17 +use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
  18 +use Symfony\Component\Security\Core\Exception\BadCredentialsException;
  19 +use Cacic\WSBundle\Security\User\WebserviceUserProvider;
  20 +use Symfony\Component\HttpFoundation\JsonResponse;
  21 +
  22 +
  23 +class ApiKeyAuthenticator implements SimplePreAuthenticatorInterface {
  24 + protected $userProvider;
  25 +
  26 + public function __construct(WebserviceUserProvider $userProvider)
  27 + {
  28 + $this->userProvider = $userProvider;
  29 + }
  30 +
  31 + public function createToken(Request $request, $providerKey)
  32 + {
  33 + $data = $request->getContent();
  34 +
  35 + $usuario = json_decode($data);
  36 +
  37 + // look for an apikey query parameter
  38 + //$apiKey = $request->query->get('apikey');
  39 + $apiKey = $usuario->password;
  40 +
  41 + sprintf("JSON login API Key ". $apiKey);
  42 +
  43 + // or if you want to use an "apikey" header, then do something like this:
  44 + // $apiKey = $request->headers->get('apikey');
  45 +
  46 + if (!$apiKey) {
  47 + throw new BadCredentialsException('No API key found');
  48 + }
  49 +
  50 + return new PreAuthenticatedToken(
  51 + 'anon.',
  52 + $apiKey,
  53 + $providerKey
  54 + );
  55 + }
  56 +
  57 + public function authenticateToken(TokenInterface $token, UserProviderInterface $userProvider, $providerKey)
  58 + {
  59 + $apiKey = $token->getCredentials();
  60 + $username = $this->userProvider->getUsernameForApiKey($apiKey);
  61 +
  62 + if (!$username) {
  63 + throw new AuthenticationException(
  64 + sprintf('API Key "%s" does not exist.', $apiKey)
  65 + );
  66 + }
  67 +
  68 + $user = $this->userProvider->loadUserByUsername($username);
  69 +
  70 + return new PreAuthenticatedToken(
  71 + $user,
  72 + $apiKey,
  73 + $providerKey,
  74 + $user->getRoles()
  75 + );
  76 + }
  77 +
  78 + public function supportsToken(TokenInterface $token, $providerKey)
  79 + {
  80 + return $token instanceof PreAuthenticatedToken && $token->getProviderKey() === $providerKey;
  81 + }
  82 +
  83 + public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
  84 + {
  85 + return new JsonResponse("Authentication Failed.", 403);
  86 + }
  87 +
  88 +}
0 89 \ No newline at end of file
... ...
src/Cacic/WSBundle/Security/User/WebserviceUserProvider.php 0 → 100644
... ... @@ -0,0 +1,79 @@
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: eduardo
  5 + * Date: 23/09/14
  6 + * Time: 23:43
  7 + */
  8 +
  9 +namespace Cacic\WSBundle\Security\User;
  10 +
  11 +use Symfony\Component\DependencyInjection\ContainerInterface;
  12 +use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  13 +use Symfony\Component\Security\Core\User\UserProviderInterface;
  14 +use Symfony\Component\Security\Core\User\UserInterface;
  15 +use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
  16 +use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
  17 +use Cacic\CommonBundle\Entity\Usuario as WebserviceUser;
  18 +
  19 +
  20 +class WebserviceUserProvider implements UserProviderInterface {
  21 +
  22 + private $container;
  23 +
  24 +
  25 + public function __construct(ContainerInterface $container)
  26 + {
  27 + $this->container = $container;
  28 + $this->em = $container->get('doctrine')->getManager();
  29 + }
  30 +
  31 +
  32 + public function getUsernameForApiKey($apiKey)
  33 + {
  34 + // Look up the username based on the token in the database, via
  35 + // an API call, or do something entirely different
  36 + $usuario = $this->em->getRepository('CacicCommonBundle:Usuario')->findOneBy(array('apiKey' => $apiKey));
  37 +
  38 + if ($usuario) {
  39 + return $usuario->getUsername();
  40 + }
  41 +
  42 + throw new UsernameNotFoundException(
  43 + sprintf('Username "%s" does not exist.', $apiKey)
  44 + );
  45 + }
  46 +
  47 + public function loadUserByUsername($username)
  48 + {
  49 + // make a call to your webservice here
  50 + //$userData = '...';
  51 + // pretend it returns an array on success, false if there is no user
  52 + $usuario = $this->em->getRepository('CacicCommonBundle:Usuario')->findOneBy(array('nmUsuarioAcesso' => $username));
  53 +
  54 + if ($usuario) {
  55 + return $usuario;
  56 + }
  57 +
  58 + throw new UsernameNotFoundException(
  59 + sprintf('Username "%s" does not exist.', $username)
  60 + );
  61 + }
  62 +
  63 + public function refreshUser(UserInterface $user)
  64 + {
  65 + if (!$user instanceof WebserviceUser) {
  66 + throw new UnsupportedUserException(
  67 + sprintf('Instances of "%s" are not supported.', get_class($user))
  68 + );
  69 + }
  70 +
  71 + return $this->loadUserByUsername($user->getUsername());
  72 + }
  73 +
  74 + public function supportsClass($class)
  75 + {
  76 + return $class === 'Cacic\CommonBundle\Entity\Usuario';
  77 + }
  78 +
  79 +}
0 80 \ No newline at end of file
... ...
src/Cacic/WSBundle/Tests/Controller/DefaultControllerTest.php
... ... @@ -12,6 +12,6 @@ class DefaultControllerTest extends WebTestCase
12 12  
13 13 $crawler = $client->request('GET', '/hello/Fabien');
14 14  
15   - $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
  15 + $this->assertFalse($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
16 16 }
17 17 }
... ...
src/Cacic/WSBundle/Tests/Controller/NeoControllerTest.php 0 → 100644
... ... @@ -0,0 +1,570 @@
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: gabi
  5 + * Date: 25/07/14
  6 + * Time: 11:47
  7 + */
  8 +
  9 +namespace Cacic\WSBundle\Tests\Controller;
  10 +
  11 +use Cacic\CommonBundle\Tests\BaseTestCase;
  12 +use Symfony\Component\HttpFoundation\Session;
  13 +use Symfony\Component\Serializer\Serializer;
  14 +use Symfony\Component\Serializer\Encoder\JsonEncoder;
  15 +
  16 +
  17 +
  18 +class NeoControllerTest extends BaseTestCase
  19 +{
  20 + /**
  21 + * Método que cria dados comuns a todos os testes
  22 + */
  23 + public function setUp() {
  24 + // Load setup from BaseTestCase method
  25 + parent::setUp();
  26 +
  27 + $this->client = static::createClient();
  28 + $this->container = $this->client->getContainer();
  29 + $this->apiKey = $this->container->getParameter('test_api_key');
  30 + }
  31 +
  32 + /**
  33 + * Testa a comunicação SSL
  34 + */
  35 + public function testCommunication()
  36 + {
  37 + $logger = $this->container->get('logger');
  38 + $client = $this->client;
  39 + $client->request(
  40 + 'POST',
  41 + '/ws/neo',
  42 + array(),
  43 + array(),
  44 + array(
  45 + 'CONTENT_TYPE' => 'application/json',
  46 + 'HTTPS' => true
  47 + ),
  48 + '{}'
  49 + );
  50 +
  51 +
  52 + //$logger->debug("11111111111111111111111111111111111111 ".print_r($client->getResponse()->getStatusCode(), true));
  53 +
  54 + $this->assertEquals(200,$client->getResponse()->getStatusCode());
  55 + }
  56 +
  57 + /**
  58 + * test login
  59 + */
  60 + public function testGetLogin()
  61 + {
  62 +
  63 + $logger = $this->container->get('logger');
  64 + $this->client->request(
  65 + 'POST',
  66 + '/ws/neo/getLogin',
  67 + array(),
  68 + array(),
  69 + array(
  70 + 'CONTENT_TYPE' => 'application/json',
  71 + 'HTTPS' => true
  72 + ),
  73 + '{ "user" : "cacic-adm",
  74 + "password": "'.$this->apiKey.'"
  75 + }'
  76 + );
  77 + $logger->debug("Dados JSON de login enviados\n".$this->client->getRequest()->getcontent());//user e password
  78 +
  79 + $response = $this->client->getResponse();
  80 + //$logger->debug("Response:\n".print_r($response,true)); // arrays session e chavecrip
  81 + $data = $response->getContent();
  82 + //$logger->debug("Response data:\n".print_r($data,true)); //session e chavecrip
  83 + // JSON Serialization
  84 + $json = json_decode($data, true);
  85 + $logger->debug("Response json: \n".print_r($json,true)); //session e chavecrip
  86 + $session = $json['session'];
  87 + $chavecrip= $json['chavecrip'];
  88 +
  89 + $this->assertTrue(is_string($session));
  90 +
  91 + $this->assertTrue(is_string($chavecrip));
  92 +
  93 + }
  94 +
  95 + /**
  96 + *Teste da sessão
  97 + */
  98 + public function testSession() {
  99 + $logger = $this->container->get('logger');
  100 + $this->client->request(
  101 + 'POST',
  102 + '/ws/neo/getLogin',
  103 + array(),
  104 + array(),
  105 + array(
  106 + 'CONTENT_TYPE' => 'application/json',
  107 + //'HTTPS' => true
  108 + ),
  109 + '{ "user" : "cacic-adm",
  110 + "password": "'.$this->apiKey.'"
  111 + }'
  112 + );
  113 + $logger->debug("Dados JSON de login enviados \n".$this->client->getRequest()->getcontent());
  114 +
  115 + $response = $this->client->getResponse();
  116 + $data = $response->getContent();
  117 +
  118 + // JSON Serialization
  119 + $json = json_decode($data, true);
  120 + $session = $json['session'];
  121 +
  122 + // Testa a sessão
  123 + $this->client->request(
  124 + 'POST',
  125 + '/ws/neo/checkSession',
  126 + array(),
  127 + array(),
  128 + array(
  129 + 'CONTENT_TYPE' => 'application/json',
  130 + //'HTTPS' => true
  131 + ),
  132 + '{ "session" : '.$session.'
  133 + }'
  134 + );
  135 +
  136 + $response = $this->client->getResponse();
  137 + $status = $response->getStatusCode();
  138 + $logger->debug("Response status: $status");
  139 +
  140 + $this->assertEquals($status, 200);
  141 + }
  142 +
  143 + /**
  144 + * Testa inserção do computador se não existir
  145 + */
  146 + public function testGetTest() {
  147 + $logger = $this->container->get('logger');
  148 + $this->client->request(
  149 + 'POST',
  150 + '/ws/neo/getTest',
  151 + array(),
  152 + array(),
  153 + array(
  154 + 'CONTENT_TYPE' => 'application/json',
  155 + //'HTTPS' => true
  156 + ),
  157 + '{
  158 + "computador": {
  159 + "networkDevices": [
  160 + {
  161 + "ipv4": "10.1.0.56",
  162 + "ipv6": "fe80::295b:a8db:d433:ebe%4",
  163 + "mac": "9C:D2:1E:EA:E0:89",
  164 + "netmask_ipv4": "255.255.255.0",
  165 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  166 + "nome": "Wi-Fi"
  167 + },
  168 + {
  169 + "ipv4": "192.168.56.1",
  170 + "ipv6": "fe80::19f2:4739:8a9e:45e4%16",
  171 + "mac": "08:00:27:00:14:2B",
  172 + "netmask_ipv4": "255.255.255.0",
  173 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  174 + "nome": "VirtualBox Host-Only Network"
  175 + }
  176 + ],
  177 + "operatingSystem": {
  178 + "idOs": 176,
  179 + "nomeOs": "Windows_NT"
  180 + },
  181 + "usuario": "Eric Menezes",
  182 + "nmComputador": "Notebook-XPTO",
  183 + "versaoAgente": "2.8.0"
  184 + }
  185 + }'
  186 + );
  187 + $logger->debug("Dados JSON do computador enviados \n".$this->client->getRequest()->getcontent());
  188 +
  189 + $response = $this->client->getResponse();
  190 + $status = $response->getStatusCode();
  191 + $logger->debug("Response status: $status");
  192 +
  193 + $this->assertEquals($status, 200);
  194 +
  195 + }
  196 +
  197 + /**
  198 + * Testconfig
  199 + */
  200 + public function testConfig() {
  201 + $logger = $this->container->get('logger');
  202 + $this->client->request(
  203 + 'POST',
  204 + '/ws/neo/config',
  205 + array(),
  206 + array(),
  207 + array(
  208 + 'CONTENT_TYPE' => 'application/json',
  209 + //'HTTPS' => true
  210 + ),
  211 + '{
  212 + "computador": {
  213 + "networkDevices": [
  214 + {
  215 + "ipv4": "10.1.0.56",
  216 + "ipv6": "fe80::295b:a8db:d433:ebe%4",
  217 + "mac": "9C:D2:1E:EA:E0:89",
  218 + "netmask_ipv4": "255.255.255.0",
  219 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  220 + "nome": "Wi-Fi"
  221 + },
  222 + {
  223 + "ipv4": "192.168.56.1",
  224 + "ipv6": "fe80::19f2:4739:8a9e:45e4%16",
  225 + "mac": "08:00:27:00:14:2B",
  226 + "netmask_ipv4": "255.255.255.0",
  227 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  228 + "nome": "VirtualBox Host-Only Network"
  229 + }
  230 + ],
  231 + "operatingSystem": {
  232 + "idOs": 176,
  233 + "nomeOs": "Windows_NT"
  234 + },
  235 + "usuario": "Eric Menezes",
  236 + "nmComputador": "Notebook-XPTO",
  237 + "versaoAgente": "2.8.0"
  238 + }
  239 + }'
  240 + );
  241 + $logger->debug("Dados JSON do computador enviados \n".$this->client->getRequest()->getcontent());
  242 +
  243 + $response = $this->client->getResponse();
  244 + $status = $response->getStatusCode();
  245 + $logger->debug("Response status: $status");
  246 + $logger->debug("JSON do getConfig: \n".$response->getContent());
  247 +
  248 + $this->assertEquals($status, 200);
  249 +
  250 + }
  251 +
  252 + /**
  253 + * Essa função vai falhar se não tiver nenhum computador cadastrado
  254 + */
  255 + public function testSemMac() {
  256 + $logger = $this->container->get('logger');
  257 + $this->client->request(
  258 + 'POST',
  259 + '/ws/neo/update',
  260 + array(),
  261 + array(),
  262 + array(
  263 + 'CONTENT_TYPE' => 'application/json',
  264 + //'HTTPS' => true
  265 + ),
  266 + '{
  267 + "computador": {
  268 + "networkDevices": [
  269 + {
  270 + "ipv4": "10.1.0.56",
  271 + "ipv6": "fe80::295b:a8db:d433:ebe%4",
  272 + "netmask_ipv4": "255.255.255.0",
  273 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  274 + "nome": "Wi-Fi"
  275 + },
  276 + {
  277 + "ipv4": "192.168.56.1",
  278 + "ipv6": "fe80::19f2:4739:8a9e:45e4%16",
  279 + "netmask_ipv4": "255.255.255.0",
  280 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  281 + "nome": "VirtualBox Host-Only Network"
  282 + }
  283 + ],
  284 + "operatingSystem": {
  285 + "idOs": 176,
  286 + "nomeOs": "Windows_NT"
  287 + },
  288 + "usuario": "Eric Menezes",
  289 + "nmComputador": "Notebook-XPTO",
  290 + "versaoAgente": "2.8.0"
  291 + }
  292 + }'
  293 + );
  294 + $logger->debug("Dados JSON do computador enviados sem MAC para o getUpdate \n".$this->client->getRequest()->getcontent());
  295 +
  296 + $response = $this->client->getResponse();
  297 + $status = $response->getStatusCode();
  298 + $logger->debug("Response status: $status");
  299 + //$logger->debug("JSON do getConfig: \n".$response->getContent());
  300 +
  301 + $this->assertEquals($status, 500);
  302 +
  303 + }
  304 +
  305 + /**
  306 + * Retorna o último computador cadastrado caso seja enviado um sem Mac
  307 + */
  308 + public function testUpdate() {
  309 + $logger = $this->container->get('logger');
  310 + // Primeiro insere um computador válido
  311 + $this->client->request(
  312 + 'POST',
  313 + '/ws/neo/getTest',
  314 + array(),
  315 + array(),
  316 + array(
  317 + 'CONTENT_TYPE' => 'application/json',
  318 + //'HTTPS' => true
  319 + ),
  320 + '{
  321 + "computador": {
  322 + "networkDevices": [
  323 + {
  324 + "ipv4": "10.1.0.56",
  325 + "ipv6": "fe80::295b:a8db:d433:ebe%4",
  326 + "mac": "9C:D2:1E:EA:E0:89",
  327 + "netmask_ipv4": "255.255.255.0",
  328 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  329 + "nome": "Wi-Fi"
  330 + },
  331 + {
  332 + "ipv4": "192.168.56.1",
  333 + "ipv6": "fe80::19f2:4739:8a9e:45e4%16",
  334 + "mac": "08:00:27:00:14:2B",
  335 + "netmask_ipv4": "255.255.255.0",
  336 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  337 + "nome": "VirtualBox Host-Only Network"
  338 + }
  339 + ],
  340 + "operatingSystem": {
  341 + "idOs": 176,
  342 + "nomeOs": "Windows_NT"
  343 + },
  344 + "usuario": "Eric Menezes",
  345 + "nmComputador": "Notebook-XPTO",
  346 + "versaoAgente": "2.8.0"
  347 + }
  348 + }'
  349 + );
  350 + $logger->debug("Dados JSON do computador enviados antes do getUpdate \n".$this->client->getRequest()->getcontent());
  351 +
  352 + $response = $this->client->getResponse();
  353 + $status = $response->getStatusCode();
  354 + $logger->debug("Response status: $status");
  355 +
  356 + $this->assertEquals($status, 200);
  357 +
  358 + // Agora tenta inserir um sem MAC
  359 + $this->client->request(
  360 + 'POST',
  361 + '/ws/neo/update',
  362 + array(),
  363 + array(),
  364 + array(
  365 + 'CONTENT_TYPE' => 'application/json',
  366 + //'HTTPS' => true
  367 + ),
  368 + '{
  369 + "computador": {
  370 + "networkDevices": [
  371 + {
  372 + "ipv4": "10.1.0.56",
  373 + "ipv6": "fe80::295b:a8db:d433:ebe%4",
  374 + "netmask_ipv4": "255.255.255.0",
  375 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  376 + "nome": "Wi-Fi"
  377 + },
  378 + {
  379 + "ipv4": "192.168.56.1",
  380 + "ipv6": "fe80::19f2:4739:8a9e:45e4%16",
  381 + "netmask_ipv4": "255.255.255.0",
  382 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  383 + "nome": "VirtualBox Host-Only Network"
  384 + }
  385 + ],
  386 + "operatingSystem": {
  387 + "idOs": 176,
  388 + "nomeOs": "Windows_NT"
  389 + },
  390 + "usuario": "Eric Menezes",
  391 + "nmComputador": "Notebook-XPTO",
  392 + "versaoAgente": "2.8.0"
  393 + }
  394 + }'
  395 + );
  396 + $logger->debug("Dados JSON do computador enviados sem MAC para o getUpdate \n".$this->client->getRequest()->getcontent());
  397 +
  398 + $response = $this->client->getResponse();
  399 + $status = $response->getStatusCode();
  400 + $logger->debug("Response status: $status");
  401 + $logger->debug("JSON do getUpdate: \n".$response->getContent());
  402 +
  403 + $this->assertEquals($status, 200);
  404 +
  405 + }
  406 +
  407 + /**
  408 + * Teste de inserção das coletas
  409 + */
  410 + public function testColeta() {
  411 + $logger = $this->container->get('logger');
  412 + $this->client->request(
  413 + 'POST',
  414 + '/ws/neo/coleta',
  415 + array(),
  416 + array(),
  417 + array(
  418 + 'CONTENT_TYPE' => 'application/json',
  419 + //'HTTPS' => true
  420 + ),
  421 + '{
  422 + "computador": {
  423 + "networkDevices": [
  424 + {
  425 + "ipv4": "10.1.0.56",
  426 + "ipv6": "fe80::295b:a8db:d433:ebe%4",
  427 + "mac": "9C:D2:1E:EA:E0:89",
  428 + "netmask_ipv4": "255.255.255.0",
  429 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  430 + "nome": "Wi-Fi"
  431 + },
  432 + {
  433 + "ipv4": "192.168.56.1",
  434 + "ipv6": "fe80::19f2:4739:8a9e:45e4%16",
  435 + "mac": "08:00:27:00:14:2B",
  436 + "netmask_ipv4": "255.255.255.0",
  437 + "netmask_ipv6": "ffff:ffff:ffff:ffff::",
  438 + "nome": "VirtualBox Host-Only Network"
  439 + }
  440 + ],
  441 + "operatingSystem": {
  442 + "idOs": 176,
  443 + "nomeOs": "Windows_NT"
  444 + },
  445 + "usuario": "Eric Menezes",
  446 + "nmComputador": "Notebook-XPTO",
  447 + "versaoAgente": "2.8.0"
  448 + },
  449 + "hardware": {
  450 + "bios": {
  451 + "releaseDate": "11/12/2013",
  452 + "romSize": "4096 kB",
  453 + "runtimeSize": "128 kB",
  454 + "vendor": "Dell Inc.",
  455 + "version": "A07"
  456 + },
  457 + "cpu": {
  458 + "clock": "768000000 Hz",
  459 + "name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz",
  460 + "vendor": "Intel Corp."
  461 + },
  462 + "ethernet_card": {
  463 + "capacity": "100000000 bits/s",
  464 + "description": "Ethernet interface",
  465 + "logicalname": "eth0",
  466 + "product": "RTL8101E/RTL8102E PCI Express Fast Ethernet controller",
  467 + "serial": "78:2b:cb:eb:36:24",
  468 + "vendor": "Realtek Semiconductor Co., Ltd."
  469 + },
  470 + "isNotebook": {
  471 + "value": "true"
  472 + },
  473 + "memory": {
  474 + "size": "8589934592 bytes"
  475 + },
  476 + "motherboard": {
  477 + "assetTag": "Not Specified",
  478 + "manufacturer": "Dell Inc.",
  479 + "onboardCapabilities": [
  480 + "Video"
  481 + ],
  482 + "productName": "0YK7DY",
  483 + "serialNumber": ".CSQKLZ1.BR1081943R0013.",
  484 + "version": "A00"
  485 + },
  486 + "wireless_card": {
  487 + "description": "Wireless interface",
  488 + "firmware": "N/A",
  489 + "logicalname": "wlan0",
  490 + "product": "QCA9565 / AR9565 Wireless Network Adapter",
  491 + "serial": "9c:d2:1e:ea:e0:89",
  492 + "vendor": "Qualcomm Atheros"
  493 + }
  494 + },
  495 + "software": {
  496 + "": {
  497 + "name": ""
  498 + },
  499 + "account-plugin-aim": {
  500 + "description": "Messaging account plugin for AIM",
  501 + "installed_size": "941",
  502 + "name": "account-plugin-aim",
  503 + "url": "http://wiki.gnome.org/Empathy",
  504 + "version": "3.8.6-0ubuntu9"
  505 + },
  506 + "account-plugin-facebook": {
  507 + "description": "GNOME Control Center account plugin for single signon - facebook",
  508 + "installed_size": "65",
  509 + "name": "account-plugin-facebook",
  510 + "url": "https://launchpad.net/account-plugins",
  511 + "version": "0.11+14.04.20140409.1-0ubuntu1"
  512 + },
  513 + "account-plugin-flickr": {
  514 + "description": "GNOME Control Center account plugin for single signon - flickr",
  515 + "installed_size": "64",
  516 + "name": "account-plugin-flickr",
  517 + "url": "https://launchpad.net/account-plugins",
  518 + "version": "0.11+14.04.20140409.1-0ubuntu1"
  519 + },
  520 + "account-plugin-google": {
  521 + "description": "GNOME Control Center account plugin for single signon",
  522 + "installed_size": "66",
  523 + "name": "account-plugin-google",
  524 + "url": "https://launchpad.net/account-plugins",
  525 + "version": "0.11+14.04.20140409.1-0ubuntu1"
  526 + },
  527 + "account-plugin-jabber": {
  528 + "description": "Messaging account plugin for Jabber/XMPP",
  529 + "installed_size": "941",
  530 + "name": "account-plugin-jabber",
  531 + "url": "http://wiki.gnome.org/Empathy",
  532 + "version": "3.8.6-0ubuntu9"
  533 + },
  534 + "account-plugin-salut": {
  535 + "description": "Messaging account plugin for Local XMPP (Salut)",
  536 + "installed_size": "941",
  537 + "name": "account-plugin-salut",
  538 + "url": "http://wiki.gnome.org/Empathy",
  539 + "version": "3.8.6-0ubuntu9"
  540 + },
  541 + "account-plugin-twitter": {
  542 + "description": "GNOME Control Center account plugin for single signon - twitter",
  543 + "installed_size": "63",
  544 + "name": "account-plugin-twitter",
  545 + "url": "https://launchpad.net/account-plugins",
  546 + "version": "0.11+14.04.20140409.1-0ubuntu1"
  547 + }
  548 + }
  549 + }'
  550 + );
  551 + $logger->debug("Dados JSON do computador enviados para a coleta: \n".$this->client->getRequest()->getcontent());
  552 +
  553 + $response = $this->client->getResponse();
  554 + $status = $response->getStatusCode();
  555 + $logger->debug("Response status: $status");
  556 + //$logger->debug("JSON da coleta: \n".$response->getContent());
  557 +
  558 + $this->assertEquals($status, 200);
  559 + }
  560 +
  561 + /**
  562 + * Método que apaga todos os dados criados no teste
  563 + */
  564 + public function tearDown() {
  565 + // Executa método de limpeza de todos os casos de teste
  566 + parent::tearDown();
  567 +
  568 + }
  569 +
  570 +}
0 571 \ No newline at end of file
... ...