<commit_before><?php
session_start();

include_once("./include/functions/func.php");

/*
* Handle allow access for scientists in admin panel
*/

if(/*isset($_SESSION['USER_LOGGED_IN']) && */isset($_REQUEST['hash']) && !empty($_REQUEST['hash']) && is_md5($_REQUEST['hash'])){
    if(isset($_SESSION["ADMIN_ACCOUNT"]) && $_SESSION["ADMIN_ACCOUNT"] == "YES"){
       
       include_once("./config.php");
       include_once("./include/functions/dbconnect.php"); 
           
       $request = $_REQUEST['hash'];
           
       // update his request, set to not pending one              
       $sql = "UPDATE request
                 SET
                 pending = 0, accepted = 1 
                 WHERE
                 uid = (SELECT userid 
                         FROM user
                         WHERE hash = '". $request ."')";
                            
        $db->exec($sql);
       
        // USER IS NOW IN A SCIENTIST GROUP<commit_msg>* security fix<commit_after><?php
session_start();

include_once("./include/functions/func.php");

/*
* Handle allow access for scientists in admin panel
*/

if(isset($_SESSION['USER_LOGGED_IN']) && isset($_REQUEST['hash']) && !empty($_REQUEST['hash']) && is_md5($_REQUEST['hash'])){
    if(isset($_SESSION["ADMIN_ACCOUNT"]) && $_SESSION["ADMIN_ACCOUNT"] == "YES"){
       
       include_once("./config.php");
       include_once("./include/functions/dbconnect.php"); 
           
       $request = $_REQUEST['hash'];
           
       // update his request, set to not pending one              
       $sql = "UPDATE request
                 SET
                 pending = 0, accepted = 1 
                 WHERE
                 uid = (SELECT userid 
                         FROM user
                         WHERE hash = '". $request ."')";
                            
        $db->exec($sql);
       
        // USER IS NOW IN A SCIENTIST GROUP
{'fraction_non_alphanumeric': 0.14824515453116816, 'fraction_numerical': 0.003143006809848088, 'mean_word_length': 1.6638772663877266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2807216', 'n_tokens_mistral': 519, 'n_tokens_neox': 495, 'n_words': 111}