function Push_Modify_Entries()
{
    print '<br>HERE<br>';
    $attribute_changer = $GLOBALS['AttributeChangerPlugin'];
    $PLUGIN_FILES_DIR = $attribute_changer->AttributeChangerData['PLUGIN_FILES_DIR'];
    $AttributeChangerData = $attribute_changer->AttributeChangerData;
    $case_array = $AttributeChangerData['case_array'];
    $Session = $attribute_changer->Current_Session;
    foreach ($Session->Committed_Modify_Entries as $email_key => $modify_attributes_and_values) {
        $exists = Sql_Fetch_Row_Query(sprintf('select id from %s where email = "%s"', $AttributeChangerData['tables']['user'], $email_key));
        if (!$exists[0]) {
            //$Failed_Modify_Entries[$email_key] = $modify_attributes_and_values;
        } else {
            $modify_user_id = $exists[0];
            print '<br>current user id<br>' . $modify_user_id . '<br>';
            $modify_value_array = array();
            foreach ($modify_attributes_and_values as $attribute_id => $attribute_value_id) {
                if ($case_array[$Session->attribute_list[$attribute_id]['type']] == 'case_3') {
                    $modify_value_array = array();
                    foreach ($attribute_value_id as $individual_id) {
                        if (array_key_exists($individual_id, $Session->attribute_list[$attribute_id]['allowed_value_ids'])) {
                            array_push($modify_value_array, $individual_id);
                        }
                    }
                    $proper_this_attribute_value = implode(',', $modify_value_array);
                } else {
                    if ($case_array[$Session->attribute_list[$attribute_id]['type']] == 'case_2') {
                        if (array_key_exists($attribute_value_id, $Session->attribute_list[$attribute_id]['allowed_value_ids'])) {
                            $proper_this_attribute_value = $attribute_value_id;
                        }
                    } else {
                        ///HERE IS MESSSSSSSSY
                        if (in_array($attribute_value_id, $Session->Modify_Entry_List[$email_key][$attribute_id])) {
                            $proper_this_attribute_value = $attribute_value_id;
                        }
                    }
                }
                print '<br>modify user:  '******' attribute id:   ' . $attribute_id . ' value  :' . $proper_this_attribute_value . '<br>';
                //need a way for 'STICKY' attributes
                print "<br>mod user id : " . $modify_user_id . "<br>";
                print "<br>IS HEREEEE FOR USER " . $modify_user_id . ' AND WITH VALUE : ' . $proper_this_attribute_value . '<br>';
                SaveCurrentUserAttribute($modify_user_id, $attribute_id, $proper_this_attribute_value);
            }
        }
    }
}
Example #2
0
        print '<html><body>' . $print_html . '</body></html>';
    }
}
if (isset($_POST['resetTable'])) {
    $query = sprintf("truncate table %s", $AttributeChangerData['tables']['user']);
    $ret1 = Sql_Query($query);
    $query = sprintf("truncate table %s", $GLOBALS['tables']['user_attribute']);
    $ret2 = Sql_Query($query);
    include_once $PLUGIN_FILES_DIR . 'New_And_Modify_Entry_Processor.php';
    $id = addNewUser('djarcaig@milburnlaw.ca@');
    if (!$id) {
        print "error with user clear<br>";
        return -1;
    }
    SaveCurrentUserAttribute($id, '1', 'fake name');
    SaveCurrentUserAttribute($id, '1', '1');
}
if (isset($_POST['submitTest']) && $_POST['submitTest'] == 'submitTest') {
    include_once $PLUGIN_FILES_DIR . 'Upload_Test_File_Processor.php';
    if (!isset($attribute_changer->Current_Session) || $attribute_changer->Current_Session == null) {
        print "<html><html>";
    }
    if ($attribute_changer->Current_Session->file_is_good == false) {
        print '</body></html>';
    } else {
        $print_html = Get_Attribute_File_Column_Match();
        $attribute_changer->Serialize_And_Store();
        print '<html><body>' . $print_html . '</body></html>';
    }
}
if (isset($_FILES['attribute_changer_file_to_upload']) && !empty($_FILES['attribute_changer_file_to_upload'])) {