Changeset 6116


Ignore:
Timestamp:
Oct 31, 2017, 11:26:40 AM (2 years ago)
Author:
joamuran
Message:

added roles management

Location:
admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/main.php

    r4734 r6116  
    119119    $moduleManifestString = file_get_contents("modules/".$moduleName."/module.json");
    120120    $module=(json_decode($moduleManifestString, TRUE));
    121     $modulefilelist[$moduleName]=$module;
     121   
     122    # If user is admin, let's add module
     123    if (in_array("adm", $_SESSION['groups']) or ($module["roles"]=="teachers"))
     124      $modulefilelist[$moduleName]=$module;
     125   
    122126  }
    123127  return $modulefilelist;
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/n4d.php

    r2960 r6116  
    5151    $url='https://127.0.0.1:9779';
    5252    $request=xmlrpc_encode_request($method, $args);
    53     error_log($request);
     53    //error_log($request);
    5454      $header[] = "Content-type: text/xml";
    5555      $header[] = "Content-length: ".strlen($request);
     
    7272       
    7373      $data = curl_exec($ch);
    74      
    75       /*
    76       $myfile = fopen("/tmp/n4dlog","a");
    77       fwrite($myfile,"\nDATA:::\n");
    78       fwrite($myfile,$data);
    79       fwrite($myfile,"\nCH:\n");
    80       fwrite($myfile,$ch);
    81       fclose($myfile);
    82      
    83        */
    84      
    85      
    86       //error_log($data); /////////////////////
    87       //error_log(curl_errno($ch)); ////////////////////////////////
    88      
     74           
    8975      curl_close($ch);
    9076     
     
    10086          if ($json=="") {
    10187            $json=$xmlobj;}
     88            # Store in session user groups
     89            if ($method=="validate_user")
     90              $_SESSION['groups']=$xmlobj[1];
     91             
    10292          echo (AESEncrypt($json));
    10393      }
Note: See TracChangeset for help on using the changeset viewer.