function find($query, $types) { global $dbfields; if ($query) { $types = get_appropriate_fields($query); $types["address"] = false; $types["department"] = false; $types["title"] = false; $types["shell"] = false; } $retres = array(); foreach ($dbfields as $f) { if (!isset($types[$f]) || !$types[$f]) { continue; } $r = search_db_fields($f, $types[$f]); foreach ($r as $p) { $retres[] = $p; } } if ($types["netid"]) { $results = search_db($types["netid"]); if (!$results) { $results = search_ldap(array("netid" => $types["netid"])); } if (count($results) > 0) { $retres[] = $results[0]; } $types["netid"] = false; } $lres = search_ldap($types); if ($lres) { foreach ($lres as $result) { $retres[] = $result; } } return uniq($retres); }
if (!file_exists($new_Sdir)) { $mode = 0777; mkdir($new_Sdir, $mode, TRUE) or die('Error Creating folder in server'); } $fileSize = $_FILES["student_photo"]["size"]; $minSize = 10000; //min size 100kbs $maxSize = 2000000; // max size 2mbs if ($fileSize > $maxSize) { die('**Image Is too big max size 2mb**'); } $type = $_FILES["student_photo"]["type"]; if ($type == "image/gif" || $type == "image/jpeg" || $type == "image/png" || $type == "image/pjpeg") { $type = substr($type, 6); $uploadfile = uniq(basename($_FILES['student_photo']['name'])); $transfer = move_uploaded_file($_FILES['student_photo']['tmp_name'], $new_Sdir . $uploadfile); //move_uploaded_file($_FILES['new_pic']['tmp_name'], "UserFiles/".$img_by."/temp/".$newname.".".$type); $upload2file = '/sms/modules/' . $new_Sdir . $uploadfile; if ($transfer) { echo "The student_photo image was successfully uploaded.\n"; echo '<br>Click <a href="' . $new_Sdir . $uploadfile . '">here</a> to view the file'; $student_photourlsrc = $upload2file; } else { $student_photourlsrc = ""; echo "<br>The student_photo Image was not transfered!\n"; } } else { die('**The file you are uploading is invalid**'); } } else {
<?php function uniq() { // Return the date and the 5 first chars of and MD5 (pseudo unique file name) return date('Y-m-d_H-i-s-') . substr(md5(getmypid() . uniqid(rand())), 0, 5); } $name = $_POST["name"]; $submission_dir = 'feedback/' . uniq() . "_" . $name . '/'; if (!mkdir($submission_dir)) { // failed to create submission directory error_log("ERR 003 \n" . "failed to create submission directory"); exit; } error_log("Start receveing files : " . count($_FILES)); error_log("Start receveing posts : " . count($_POST)); error_log("Start receveing gets : " . count($_GET)); foreach ($_POST as $key => $value) { error_log("key : " . $key); if ($key != "name") { file_put_contents($submission_dir . "/{$key}", $value); } } $mailContent = "http://www.phonations.com/" . $submission_dir; mail("*****@*****.**", "Feedback report from " . $name, $mailContent); error_log("success");
} if (count(dirs($feedback_dir)) > $feedback_max_project) { // too many projects echo "ERR 009\n"; echo "too many projects"; exit; } // create project dir if (!mkdir($project_dir)) { // failed to create project directory echo "ERR 008\n"; echo "could not create project dir"; exit; } } $submission_dir = $project_dir . uniq() . '/'; if (!mkdir($submission_dir)) { // failed to create submission directory echo "ERR 003\n"; echo "failed to create submission directory"; exit; } foreach ($feedback_files as $file) { $dest = $submission_dir . '/' . $file; $fh = fopen($dest, "w"); if (!$fh) { // failed to create file echo "ERR 004 {$file}\n"; echo "failed to create file"; continue; }
function de($method, $s) { switch ($method) { case 'snd': break; case 'bin': $s = bin_de($s); break; case 'dec': $s = dec_de($s); break; case 'oct': $s = oct_de($s); break; case 'hex': $s = hex_de($s); break; case 'rot': $s = rotate($s, 26 - $_POST['rot'], 10 - $_POST['nrot']); break; case 'url': $s = $_POST['url_raw'] == 'on' ? rawurldecode($s) : urldecode($s); break; case 'ur2': $s = urldecode($s); break; case 'raw': break; case 'stmwth': break; case 'rev': $s = str_rev($s); break; case 'spe': $s = html_entity_decode($s); break; case 'hen': break; case 'nbase': $s = base_conv($s, 1); break; case 'base': $s = base_de($s); break; case 'md5': addmsg(INFO, '<a href="http://gdataonline.com/seekhash.php" target="_blank">http://gdataonline.com/seekhash.php</a>'); break; case 'crypt': break; case 'stu': break; case 'crv': $s = case_rev($s); break; case 'stl': break; case 'ucw': break; case 'bbs': break; case 'bsd': break; case 'srt': $s = mysort($s, 1); break; case 'rpt': break; case 'unq': $s = uniq($s, 1); break; case 'rf': $s = sqr($s, 1); break; case 'pcr': break; case 'acc': $s = accumulation($s, 1); break; case 'uue': $s = convert_uudecode($s); break; case 'det': break; case 'ttb': break; case 'mut': break; case 'sha1': break; case 'msk': break; case 'ref': $s = sqr_reflect($s); break; case 'crc16': break; case 'crc32': break; case 'sta': break; case 'rep': $s = gen_rep_de($s); break; case 'cor': break; case 'pcm': break; case 'ascii': $s = ASCIIFilter_de($s); break; case 'ave': break; case 'miv': break; case 'mmtp': break; case 'mro': $s = matrix_rotate($s, 1); break; case 'mtr': $s = matrix_transpose($s); break; case 'cac': break; case 'ctr': break; case 'swd': break; case 'che': break; case 'key': $s = key_xor($_POST['key'], $s); break; case 'bre': $s = bit_rev($s); break; case 'bod': $s = bitorder_de($_POST['order'], $s); break; case 'tra': $s = tran(12 - $_POST['transpose'], $s, 1); break; case 'quot': break; default: addmsg(ERR, 'Undefined Method: ' . $method); } return $s; }