jmontoyaa 8 gadi atpakaļ
vecāks
revīzija
6b4850a02e

+ 0 - 3
app/Resources/public/css/base.css

@@ -111,9 +111,6 @@ a.thumbnail:hover{
   margin-top: 10px;
   margin-bottom: 10px;
 }
-#formLogin label{
-    display: none;
-}
 #login_block #formLogin .form-group{
   display: none;
 }

+ 3 - 3
src/Chamilo/CoreBundle/Resources/views/default/admin/settings_index.html.twig

@@ -7,7 +7,7 @@ $(document).ready(function() {
         }
     });
 
-{% if _u.is_admin %}
+{% if is_granted('ROLE_ADMIN') %}
     (function(CKEDITOR) {
         CKEDITOR.replace('extra_content');
 
@@ -49,7 +49,7 @@ $(document).ready(function() {
             <div class="panel panel-default {{ block_item.class }}">
                 <div class="panel-heading">
                     {{ block_item.icon }} {{ block_item.label }}
-                    {% if block_item.editable and _u.is_admin %}
+                    {% if block_item.editable and is_granted('ROLE_ADMIN') %}
                         <a class="admin-edit-block pull-right" href="#" data-label="{{ block_item.label }}" title="{{ 'Edit' | get_lang }}" data-id="{{ block_item.class }}">
                             <img src="{{ "edit.png"|icon(22) }}" width="22" height="22" alt="{{ "Edit"|get_lang }}" title="{{ "Edit"|get_lang }}" />
                         </a>
@@ -92,7 +92,7 @@ $(document).ready(function() {
     {% endfor %}
 </section>
 
-{% if _u.is_admin %}
+{% if is_granted('ROLE_ADMIN') %}
     <div class="modal fade" id="modal-extra">
         <div class="modal-dialog">
             <div class="modal-content">

+ 1 - 1
src/Chamilo/CoreBundle/Resources/views/default/create_course/add_course.html.twig

@@ -39,7 +39,7 @@
             </div>
         </div>
     </div>
-    {% if ("allow_user_course_subscription_by_course_admin" | get_setting) == 'true' or _u.is_admin == 1 %}
+    {% if ("allow_user_course_subscription_by_course_admin" | get_setting) == 'true' or is_granted('ROLE_ADMIN') %}
     <div class="col-md-3">
         <div class="thumbnail">
 

+ 1 - 1
src/Chamilo/CoreBundle/Resources/views/default/layout/hot_courses.html.twig

@@ -24,7 +24,7 @@ $(document).ready( function() {
     <div class="hot-course-head">
         <h4 class="hot-course-title">
             {{ "HottestCourses"|get_lang}}
-            {% if _u.is_admin %}
+            {% if is_granted('ROLE_ADMIN') %}
             <span class="pull-right">
                 <a title="{{ "Hide"|get_lang }}" alt="{{ "Hide"|get_lang }}" href="{{ _p.web_main }}admin/settings.php?search_field=show_hot_courses&submit_button=&_qf__search_settings=&category=search_setting">
                     <i class="fa fa-eye" aria-hidden="true"></i>

+ 1 - 1
src/Chamilo/CoreBundle/Resources/views/default/layout/login_form.html.twig

@@ -1,4 +1,4 @@
-{% if _u.logged  == 0 %}
+{% if not is_granted('IS_AUTHENTICATED_FULLY') %}
 {% if login_form %}
     <div id="login_block" class="panel panel-default">
         <div class="panel-body">

+ 1 - 1
src/Chamilo/CoreBundle/Resources/views/default/layout/menu.html.twig

@@ -15,7 +15,7 @@
                     <li class="{{ item.current }}"><a href="{{ item.url }}" target="{{ item.target }}" title="{{ item.title }}">{{ item.title }}</a></li>
                 {% endfor %}
             </ul>
-           {% if _u.logged == 1 %}
+           {% if is_granted('IS_AUTHENTICATED_FULLY') %}
            <ul class="nav navbar-nav navbar-right">
                {% if user_notifications is not null %}
                <li><a href="{{ message_url }}">{{ user_notifications }}</a></li>

+ 1 - 1
src/Chamilo/CoreBundle/Resources/views/default/sequence_resource/session_requirements.html.twig

@@ -9,7 +9,7 @@
                     <img src="{{ 'item-sequence.png'|icon(48) }}" width="48" height="48">
                     <p class="sequence-course">{{ session.name }}</p>
 
-                    {% if _u.logged %}
+                    {% if is_granted('IS_AUTHENTICATED_FULLY') %}
                         <span class="label {{ session.status ? 'label-success' : 'label-danger' }}">
                             {% if session.status %}
                                 <em class="fa fa-check"></em> {{ 'Complete'|get_lang }}

+ 2 - 2
src/Chamilo/CoreBundle/Resources/views/default/session/about.html.twig

@@ -177,11 +177,11 @@
 
     <div class="row">
         <div class="col-md-4 col-md-offset-4">
-            {% if _u.logged and not is_subscribed %}
+            {% if is_granted('IS_AUTHENTICATED_FULLY') and not is_subscribed %}
                 <div class="text-center">
                     {{ subscribe_button }}
                 </div>
-            {% elseif not _u.logged %}
+            {% elseif not is_granted('IS_AUTHENTICATED_FULLY') %}
                 {% if 'allow_registration'|get_setting == 'true' %}
                     <a href="{{ _p.web_main ~ 'auth/inscription.php' }}" class="btn btn-info btn-lg">
                         <em class="fa fa-sign-in fa-fw"></em> {{ 'SignUp'|get_lang }}

+ 0 - 20
src/Chamilo/PageBundle/Resources/views/Security/login.html.twig

@@ -1,20 +0,0 @@
-{#
-
-This file is part of the Sonata package.
-
-(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-
-#}
-
-{% extends "SonataUserBundle:Security:base_login.html.twig" %}
-
-{% block fos_user_content %}
-    {% if app.request.session.get('sonata_basket_delivery_redirect') %}
-        {% include 'SonataBasketBundle:Basket:stepper.html.twig' with {step: 'identification'} %}
-    {% endif %}
-
-    {{ parent() }}
-{% endblock fos_user_content %}

+ 3 - 3
src/Chamilo/ThemeBundle/Resources/views/Layout/topbar.html.twig

@@ -13,7 +13,7 @@
                     <img src="{{ "icon-chamilo.png"|icon(22) }}" title="{{ "siteName" | get_setting }}">
                 </a>
             </div>
-            {% if _u.logged %}
+            {% if is_granted('IS_AUTHENTICATED_FULLY') %}
                 <div class="collapse navbar-collapse" id="toolbar">
                     <ul class="nav navbar-nav">
                         <li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li>
@@ -27,7 +27,7 @@
                                 <li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li>
                             </ul>
                         </li>
-                        {% if _u.is_admin == 1 %}
+                        {% if is_granted('ROLE_ADMIN') == 1 %}
                         <li class="dropdown">
                             <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a>
                             <ul class="dropdown-menu">
@@ -54,7 +54,7 @@
                         {% endif %}
                     </ul>
 
-                    {% if _u.is_admin == 1 %}
+                    {% if is_granted('ROLE_ADMIN') == 1 %}
                     <form class="navbar-form navbar-left" role="search" action="{{ _p.web_main }}admin/user_list.php" method="get">
                         <input type="text" class="form-control" placeholder="{{'SearchUsers'|get_lang }}" name="keyword">
                     </form>

+ 4 - 4
src/Chamilo/ThemeBundle/Resources/views/Navbar/user.html.twig

@@ -2,20 +2,20 @@
 {% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %}
 <li class="dropdown user user-menu">
     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
-        <img class="img-circle" src="{{ _u.avatar_small }}" alt="{{ _u.complete_name }}" />
+        <img class="img-circle" src="{{ asset(user.avatarOrAnonymous) }}" alt="{{ user.completeName }}" />
         <span class="caret"></span>
     </a>
 
     <ul class="dropdown-menu" role="menu">
         <li class="user-header">
             <div class="text-center">
-            <img class="img-circle" src="{{ _u.avatar_medium }}" alt="{{ _u.complete_name }}" />
+            <img class="img-circle" src="{{ asset(user.avatarOrAnonymous(64)) }}" alt="{{ user.completeName }}" />
             <p class="name">
                 <a href="{{ url('main', { 'name' : 'social/home.php' })}}">
-                    {{ _u.complete_name }}
+                    {{ user.completeName }}
                 </a>
             </p>
-            <p><i class="fa fa-envelope-o" aria-hidden="true"></i> {{ _u.email }}</p>
+            <p><i class="fa fa-envelope-o" aria-hidden="true"></i> {{ user.email }}</p>
             </div>
         </li>
         <li role="separator" class="divider"></li>

+ 0 - 62
src/Chamilo/ThemeBundle/Resources/views/Security/login.html.twig

@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<html class="bg-black">
-<head>
-    <meta charset="UTF-8">
-    <title>{% block title %} Log in {% endblock %}</title>
-    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
-
-    {#{% stylesheets '@admin_lte_css' %}#}
-    {#<link href="{{ asset_url }}" rel="stylesheet" type="text/css" />#}
-    {#{% endstylesheets %}#}
-
-    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
-    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
-    <!--[if lt IE 9]>
-
-    <![endif]-->
-</head>
-<body class="bg-black">
-
-<div class="form-box" id="login-box">
-    <div class="header">Sign In</div>
-    <form action="{{ path('login_check') }}" method="post">
-        <div class="body bg-gray">
-            <div class="form-group">
-                <input type="text" name="_username" class="form-control" placeholder="username" value="{{ last_username }}"/>
-            </div>
-            <div class="form-group">
-                <input type="password" name="_password" class="form-control" placeholder="Password"/>
-            </div>
-            {#
-            <div class="form-group">
-                <input type="checkbox" name="remember_me"/> Remember me
-            </div>
-            #}
-        </div>
-        <div class="footer">
-            <button type="submit" class="btn bg-olive btn-block">Sign me in</button>
-
-            <p><a href="#">I forgot my password</a></p>
-
-            <a href="register.html" class="text-center">Register a new membership</a>
-        </div>
-    </form>
-
-    <div class="margin text-center">
-        <span>Sign in using social networks</span>
-        <br/>
-        <button class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>
-        <button class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>
-        <button class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>
-
-    </div>
-</div>
-
-
-<!-- jQuery 2.0.2 -->
-<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
-<!-- Bootstrap -->
-<script src="../../js/bootstrap.min.js" type="text/javascript"></script>
-
-</body>
-</html>

+ 11 - 4
src/Chamilo/ThemeBundle/Resources/views/Sidebar/login.html.twig

@@ -3,23 +3,30 @@
 <form class="form-horizontal" action="{{ path("fos_user_security_check") }}" method="post" name="formLogin" id="formLogin">
     <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
     <fieldset>
-        <label for="login">{{ 'UserName' | trans }}</label>
         <div class="input-group">
             <div class="input-group-addon">
                 <em class="fa fa-user fa-fw"></em>
             </div>
-            <input id="login" autofocus="autofocus" placeholder="Username"
+            <input id="login" autofocus="autofocus" placeholder="{{ 'UserName' | trans }}"
                    autocapitalize="none" class="form-control" name="_username"
                    type="text">
         </div>
-        <label for="password">{{ 'Pass' | trans }}</label>
+
         <div class="input-group">
             <div class="input-group-addon">
                 <em class="fa fa-lock fa-fw"></em>
             </div>
-            <input id="password" placeholder="Pass" autocapitalize="none"
+            <input id="password" placeholder="{{ 'Pass' | trans }}" autocapitalize="none"
                    class="form-control" name="_password" type="password">
         </div>
+
+        <div class="input-group">
+            <div class="checkbox">
+                <label for="remember_me">
+                    <input type="checkbox" id="remember_me" name="_remember_me" value="on"/>{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
+                </label>
+            </div>
+        </div>
         <button class="btn-block btn btn-primary " name="submitAuth" type="submit">
             {{ 'LoginEnter' | trans }}
         </button>