Example #1
0
}
// ****************** LDAP LOOKUP END ****************
//*** check data for non-standard users
// 1: if FERPA student
if (!array_key_exists('displayname', $info[0])) {
    // display name hidden?
    // && $info[0]['edupersonprimaryaffiliation'][0]=='Student') {
    $status = 1;
}
// 2: if ORCID already in LDAP
if (array_key_exists('edupersonorcid', $info[0])) {
    $status = 2;
    $existing_orcid = $info[0]['edupersonorcid'][0];
}
// LOG status
log_status();
?>
<!DOCTYPE html>
<html>
 <head>
  <title>ORCID-webapp : Provide Existing ORCID</title>
 </head>
 <!-- header -->
 <body style='padding:20px;'>

<?php 
if (!ORCID_PRODUCTION) {
    // test stuff.
    echo '<div id="test-warn-div" class="alert" style="background-color:#f5c120">';
    echo '<strong>Warning: Test mode.  Using sandbox.orcid.org .</strong>';
    echo '</div>';
Example #2
0
			list($sku, $link, $blank) = explode("\t", $line);
	
			if (isset($link) && !empty($link)) {
				$page = file_get_html($link);
				if (isset($page)) {
					$imgURL = $page->find('#zoom1', 0)->href;
					$filename = IMG_FOLDER . VENDOR_CODE . $sku . "-2.jpg";
					echo $imgURL . " " . $filename . "\n";
					file_put_contents($filename, file_get_contents($imgURL));
					log_status('Downloaded ' . $sku . ' image from ACME');
				}
			}
		}
	}
	fclose($file2);
	log_status('ACME Done!');
}

function prepare($uid) {
	global $sku_list, $output_list, $status_file;
	$user_dir = AMAZON_DOWNLOAD . $uid . '/';
	$img_dir = $user_dir . '/img/';
	$sku_list = $user_dir . 'sku_list';
	$output_list = $user_dir . 'output_list';
	$status_file = $user_dir . 'status';
}

function log_status($status) {
	global $status_file;
	$file = fopen($status_file, 'w') or die('Unable to open file!');
	fwrite($file, $status);
Example #3
0
 function mark_failure($subject, $commands, $outs = "Not relevent", $errs = "Not relevent", $exits = "Not relevent", $reason = "TODO - no reason given")
 {
     write_dependencies($this->get_name(), $subject, false);
     log_failure($this->get_name(), $subject, $commands, $outs, $errs, $exits, isset($this->missing_dependencies[$subject]) ? $this->missing_dependencies[$subject] : NULL, $reason);
     log_status("failure", $this->get_name(), $subject, $reason);
     $this->erase_progress_bar();
     $this->display_progress_bar();
     $this->failures++;
     $this->total++;
     $this->update_count();
 }
Example #4
0
function create_label_struct($directory, $label_filename, $third_party_filename)
{
    global $default_labels;
    global $non_default_labels;
    global $opposite_label;
    global $labels;
    global $exceptions;
    global $opt_one;
    $files = get_all_scripts_in_dir($directory);
    // labelled files is a table indexed by filename, containing tables indexed
    // by default labels, which are set to 1 or 0 for default and non-default
    // respectively
    foreach ($default_labels as $default) {
        foreach ($files as $filename) {
            $labelled_files[$filename][$default] = 1;
        }
    }
    foreach ($files as $filename) {
        $labelled_files[$filename]["non-interpretable"] = "check";
    }
    // parse the file
    $lines = file($label_filename);
    if (file_exists($third_party_filename)) {
        $third_party_lines = file($third_party_filename);
    } else {
        $third_party_lines = array();
    }
    foreach ($lines as $line) {
        $line = preg_replace("/#.*\$/", "", $line);
        // remove comments
        $line = trim($line);
        // remove superfluous whitespace
        if ($line == "") {
            continue;
        }
        // skip blank lines
        process_label_file_line($line, $files, $labelled_files);
    }
    foreach ($third_party_lines as $line) {
        $line = preg_replace("/#.*\$/", "", $line);
        // remove comments
        $line = trim($line);
        // remove superfluous whitespace
        if ($line == "") {
            continue;
        }
        // skip blank lines
        process_label_file_line("3rdparty/" . $line, $files, $labelled_files);
    }
    # if -O is provided, remove all other files
    if ($opt_one) {
        foreach ($labelled_files as $key => $value) {
            if ($key !== $opt_one) {
                unset($labelled_files[$key]);
                $files = array($opt_one);
            }
        }
    }
    # init the label struct
    foreach ($labels as $label) {
        $label_struct[$label] = array();
    }
    # go over the labelled_files, and make an table indexed by label
    foreach ($files as $filename) {
        // If you have a ton of 3rd party files, dont spend time checking them
        // all, unless your actually going to use them
        if (skip_3rdparty($filename)) {
            $labelled_files[$filename]["non-interpretable"] = 0;
        } else {
            phc_assert(isset($labelled_files[$filename]), "file not found");
            // check the interpretable
            if ($labelled_files[$filename]["non-interpretable"] === "check") {
                phc_assert(check_for_plugin("tools/purity_test"), "purity not available");
                global $phc, $plugin_dir;
                if (`{$phc} --run {$plugin_dir}/tools/purity_test.la {$filename} 2>&1` == "") {
                    log_status("pure", "", $filename, "");
                    $labelled_files[$filename]["non-interpretable"] = 0;
                } else {
                    log_status("impure", "", $filename, "");
                    $labelled_files[$filename]["non-interpretable"] = 1;
                }
            }
        }
        foreach ($default_labels as $label) {
            if ($labelled_files[$filename][$label]) {
                array_push($label_struct[$label], $filename);
            } else {
                array_push($label_struct[$opposite_label[$label]], $filename);
            }
        }
    }
    // sort and generally fix up the arrays
    foreach ($labels as $label) {
        sort($label_struct[$label]);
    }
    return $label_struct;
}
Example #5
0
 /**
  * Записываем страницу в кеш
  *
  * @param $page string html код страницы
  */
 function put_cache(&$page)
 {
     if (!CACHE_PAGE || $GLOBALS['no_cache']) {
         return false;
     }
     $name = CACHE_PAGES_PATH . $this->get_cache_id();
     $file = $name . '.gz';
     if ($handle = @fopen($file, 'wb')) {
         fwrite($handle, $page);
         fclose($handle);
         log_status("cache page file has been created");
     } else {
         @mkdir(CACHE_PAGES_PATH);
         fclose('Accees denied in cache page folder (' . CACHE_PAGES_PATH . ')');
     }
     if ($GLOBALS['document_status'] == '404') {
         @touch($name . '_404');
     } else {
         @touch($name . '_200', (int) $GLOBALS['update_time'] > 0 ? $GLOBALS['update_time'] : time());
     }
 }