Преглед изворни кода

Merge branch 'ofaj' of https://github.com/chamilo/chamilo-lms into ofaj

Alex Aragon пре 8 година
родитељ
комит
fabde9d8d4

+ 3 - 3
app/Resources/public/css/themes/rainbow/default.css

@@ -213,10 +213,10 @@ a:focus {
     text-align: center;
 }
 .statistics .icon-color{
-    color: #E2007A;
+    color: #96BD0D;
 }
 .statistics .number{
-    color: #E2007A;
+    color: #96BD0D;
     font-weight: 700;
 }
 .statistics .text{
@@ -473,4 +473,4 @@ legend{
 
 /* .red_underline {
    color: red;
-} */
+} */

+ 4 - 1
app/Resources/public/css/themes/rainbow/learnpath.css

@@ -10,6 +10,9 @@
 .scorm_item_level_0{
  padding: 0 2.5em 0 0; 
 }
+.scorm_item_level_2{
+ padding: 0 2.5em 0 3em;   
+}
 .expand .fa{
     background-color: #96BD0D;
 }
@@ -254,4 +257,4 @@ table.lp_overview img {
 }
 .scorm_type_quiz{
     background: url('images/pencil.png') no-repeat right 0;
-}
+}

+ 11 - 8
main/auth/sso/sso.TCC.class.php

@@ -96,9 +96,10 @@ class ssoTCC
         $loginFailed = false;
 
         //change the way we recover the cookie depending on how it is formed
-        $sso = $this->decode_cookie($_GET['sso_cookie']);
+        $sso = $this->decode_cookie($_REQUEST['sso_cookie']);
 
         $value = explode(';;', $sso);
+        $ssoSecret = substr($value[1], 0, 5);
         $value = $value[0];
 
         $userExtraFieldValue = new ExtraFieldValue('user');
@@ -108,7 +109,7 @@ class ssoTCC
         );
 
         if ($userData) {
-            $userId = $userData['value'];
+            $userId = $userData['item_id'];
         } else {
             return false;
         }
@@ -131,9 +132,9 @@ class ssoTCC
             $uData = Database::fetch_array($result);
             //Check the user's password
             if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
-                if ($sso['secret'] === sha1($uData['username'].$sso_challenge.api_get_security_key())&&
-                    ($sso['username'] == $uData['username'])
-                ) {
+                $secret = substr(api_get_security_key(), 0, 5);
+                // Check if secret sent in sso is correct
+                if ((string) $ssoSecret == (string) $secret)  {
                     //Check if the account is active (not locked)
                     if ($uData['active']=='1') {
                         // check if the expiration date has not been reached
@@ -236,7 +237,7 @@ class ssoTCC
                         exit;
                     }
                 } else {
-                    //SHA1 of password is wrong
+                    //Secret sent through SSO is incorrect
                     $loginFailed = true;
                     Session::erase('_uid');
                     header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=wrong_password');
@@ -271,7 +272,7 @@ class ssoTCC
     {
         $key = substr(api_get_security_key(), 0, 16);
         $ivsize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
-        $iv = mcrypt_create_iv($ivsize);
+        $iv = mcrypt_create_iv($ivsize, MCRYPT_RAND);
         $valuedecode = base64_decode($value);
 
         return mcrypt_decrypt(
@@ -310,7 +311,7 @@ class ssoTCC
         }
         // If the user doesn't match a Drupal user, give the normal profile
         // link
-        if ($drupalUserIdData === false) {
+/*        if ($drupalUserIdData === false) {
             return api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
         }
         // In all other cases, generate a link to the Drupal profile edition
@@ -318,6 +319,8 @@ class ssoTCC
         $url = "{$this->protocol}{$this->domain}/user/{$drupalUserId}/edit";
 
         return $url;
+*/
+        return api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
     }
 
 }

+ 3 - 3
main/inc/local.inc.php

@@ -611,13 +611,13 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
             if ($redirectToMasterConditions) {
                 // Redirect to master server
                 $osso->ask_master();
-            } elseif (isset($_GET['sso_cookie'])) {
+            } elseif (isset($_REQUEST['sso_cookie'])) {
 
                 // Here we are going to check the origin of
                 // what the call says should be used for
                 // authentication, and ensure  we know it
                 $matches_domain = false;
-                if (isset($_GET['sso_referer'])) {
+                if (isset($_REQUEST['sso_referer'])) {
                     $protocol = api_get_setting('sso_authentication_protocol');
 
                     // sso_authentication_domain can list
@@ -633,7 +633,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
                             //  then skip other possibilities
                             // Do NOT compare the whole referer, as this might cause confusing errors with friendly urls,
                             // like in Drupal /?q=user& vs /user?
-                            $referrer = substr($_GET['sso_referer'], 0, strrpos($_GET['sso_referer'], '/'));
+                            $referrer = substr($_REQUEST['sso_referer'], 0, strrpos($_REQUEST['sso_referer'], '/'));
                             if ($protocol.trim($mu) === $referrer) {
                                 $matches_domain = true;
                                 break;

+ 8 - 1
src/Chamilo/FaqBundle/Admin/QuestionAdmin.php

@@ -62,7 +62,14 @@ class QuestionAdmin extends Admin
     protected function configureFormFields(FormMapper $formMapper)
     {
         $formMapper
-            ->add('translations', 'a2lix_translations', array())
+            ->add('translations', 'a2lix_translations',  array(
+                'fields' => array(
+                    'headline' => [],
+                    'body' => array(
+                        'attr' => array('class' => 'ckeditor')
+                    )
+                )
+            ))
             ->add(
                 'category',
                 null,

+ 4 - 2
src/Chamilo/FaqBundle/Resources/views/Faq/index.html.twig

@@ -41,7 +41,7 @@
             {% for question in category.questions if question.onlyAuthUsers in list %}
                 {% if question.isActive %}
                     <li>
-                        <a href="#{{ question.id }}"><i class="fa fa-file-text-o" aria-hidden="true"></i> 
+                        <a href="#{{ question.id }}"><i class="fa fa-file-text-o" aria-hidden="true"></i>
                             {{ question.getHeadline|e }}
                         </a>
                     </li>
@@ -58,7 +58,7 @@
             {% set list = [false, true] %}
              <h2 class="title"><i class="fa fa-question-circle" aria-hidden="true"></i> {{ category.getHeadline|e }}</h2>
         {% endif %}
-       
+
         {% for question in category.questions if question.onlyAuthUsers in list %}
             {% if question.isActive %}
                 <div class="panel panel-default">
@@ -66,7 +66,9 @@
                         {{ question.getHeadline|e }} <a name="{{ question.id }}" id="{{ question.id }}"></a>
                     </div>
                     <div class="panel-body">
+                        {% autoescape false %}
                         <p>{{ question.getBody }}</p>
+                        {% endautoescape %}
                     </div>
                 </div>
             {% endif %}