function run()
{
    $ReplaceEntry = null;
    $sock = new sockets();
    $DisableGoogleSSL = intval($sock->GET_INFO("DisableGoogleSSL"));
    $EnableGoogleSafeSearch = $sock->GET_INFO("EnableGoogleSafeSearch");
    echo "Starting......: " . date("H:i:s") . " Squid : EnableGoogleSafeSearch = '{$EnableGoogleSafeSearch}'\n";
    if (!is_numeric($EnableGoogleSafeSearch)) {
        $EnableGoogleSafeSearch = 1;
    }
    echo "Starting......: " . date("H:i:s") . " Squid : DisableGoogleSSL = {$DisableGoogleSSL}\n";
    echo "Starting......: " . date("H:i:s") . " Squid : EnableGoogleSafeSearch = {$EnableGoogleSafeSearch}\n";
    if ($DisableGoogleSSL == 0) {
        if ($EnableGoogleSafeSearch == 0) {
            echo "Starting......: " . date("H:i:s") . " Squid : change google.com DNS (disabled)\n";
            remove();
            build_progress("{disabled}", 100);
            return;
        }
    }
    if ($DisableGoogleSSL == 1) {
        $ReplaceEntry = "nosslsearch.google.com";
    }
    if ($EnableGoogleSafeSearch == 1) {
        $ReplaceEntry = "forcesafesearch.google.com";
    }
    if ($ReplaceEntry == null) {
        remove();
        build_progress("{disabled}", 100);
        return;
    }
    echo "Starting......: " . date("H:i:s") . " Squid : {$ReplaceEntry} (enabled)\n";
    build_progress("{enabled}", 5);
    addDNSGOOGLE($ReplaceEntry);
}
 /**
  *
  * @param Request $request
  * TODO ADD ROUTE, RESTRICT ACCESS
  */
 public function deleteCollectionEntryById(Request $request)
 {
     $id = $request;
     $collectionEntry = $this->entityManager->getRepository('AppBundle:Collection')->find($id);
     $this->entityManager . remove($collectionEntry);
     $this->entityManager . flush();
 }
Beispiel #3
0
 private function apply($file, $type)
 {
     require 'migration/' . $file;
     if ($type == 'remove') {
         remove();
     } else {
         install();
     }
     db()->update_migration->insert(array('id' => $file));
 }
Beispiel #4
0
 private function apply($file, $type)
 {
     require $this->dir . $file;
     if ($type == 'remove') {
         remove($this->db);
     } else {
         install($this->db);
     }
     $this->checkTable();
     $this->db->migration->insert(array('id' => $file));
 }
function run()
{
    $sock = new sockets();
    $DisableGoogleSSL = intval($sock->GET_INFO("DisableGoogleSSL"));
    if ($DisableGoogleSSL == 0) {
        echo "Starting......: " . date("H:i:s") . " Squid : nosslsearch.google.com (disabled)\n";
        remove();
        build_progress("{disabled}", 110);
        return;
    }
    echo "Starting......: " . date("H:i:s") . " Squid : nosslsearch.google.com (enabled)\n";
    build_progress("{enabled}", 5);
    addDNSGOOGLE();
}
Beispiel #6
0
function remove($path)
{
    if (is_file($path)) {
        return unlink($path);
    }
    if (is_dir($path)) {
        $path = rtrim($path, '/');
        $files = glob($path . '/*', GLOB_MARK);
        foreach ($files as $file) {
            remove($file);
        }
        return rmdir($path);
    }
    return false;
}
Beispiel #7
0
function toString($score)
{
    remove();
    echo "<div class='style'>";
    echo "<table>";
    echo "<tr><th>Pseudo</th><th>Score</th></tr>";
    foreach ($score as $element) {
        echo "<tr>";
        foreach ($element as $element2) {
            echo "<td>";
            echo $element2;
            echo "</td>";
        }
    }
    echo "</table>";
    echo "</div>";
}
Beispiel #8
0
function run()
{
    $method = strtolower($_SERVER["REQUEST_METHOD"]);
    $id = ltrim($_SERVER["REQUEST_URI"], dirname($_SERVER["SCRIPT_NAME"]));
    $id = $id !== '' ? $id : null;
    $items = array(array('id' => 0, 'title' => 'Title 1', 'format' => 1, 'releaseDate' => '2012-12-21', 'price' => '100', 'publish' => false, 'info' => ''), array('id' => 1, 'title' => 'Title 2', 'format' => 1, 'releaseDate' => '2013-12-21', 'price' => '50', 'publish' => false, 'info' => ''), array('id' => 2, 'title' => 'Title 3', 'format' => 1, 'releaseDate' => '2014-12-21', 'price' => '1000', 'publish' => false, 'info' => ''));
    switch ($method) {
        case 'get':
            return $id === null ? listing($items) : detail($id, $items);
        case 'post':
            return $id === null ? create() : badRequest();
        case 'put':
            return $id !== null ? update($id) : badRequest();
        case 'delete':
            return $id !== null ? remove($id) : badRequest();
    }
    return badRequest();
}
Beispiel #9
0
function del_items($dir)
{
    // delete files/dirs
    if (($GLOBALS["permissions"] & 01) != 01) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    $cnt = count($GLOBALS['__POST']["selitems"]);
    $err = false;
    // delete files & check for errors
    for ($i = 0; $i < $cnt; ++$i) {
        $items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
        $abs = get_abs_item($dir, $items[$i]);
        if (!@file_exists(get_abs_item($dir, $items[$i]))) {
            $error[$i] = $GLOBALS["error_msg"]["itemexist"];
            $err = true;
            continue;
        }
        if (!get_show_item($dir, $items[$i])) {
            $error[$i] = $GLOBALS["error_msg"]["accessitem"];
            $err = true;
            continue;
        }
        // Delete
        $ok = remove(get_abs_item($dir, $items[$i]));
        if ($ok === false) {
            $error[$i] = $GLOBALS["error_msg"]["delitem"];
            $err = true;
            continue;
        }
        $error[$i] = NULL;
    }
    if ($err) {
        // there were errors
        $err_msg = "";
        for ($i = 0; $i < $cnt; ++$i) {
            if ($error[$i] == NULL) {
                continue;
            }
            $err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
        }
        show_error($err_msg);
    }
    header("Location: " . make_link("list", $dir, NULL));
}
Beispiel #10
0
function del_items($dir)
{
    // check if user is allowed to delete files
    if (!permissions_grant($dir, NULL, "delete")) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    $cnt = count($GLOBALS['__POST']["selitems"]);
    $err = false;
    // delete files & check for errors
    for ($i = 0; $i < $cnt; ++$i) {
        $items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
        $abs = get_abs_item($dir, $items[$i]);
        if (!@file_exists(get_abs_item($dir, $items[$i]))) {
            $error[$i] = $GLOBALS["error_msg"]["itemexist"];
            $err = true;
            continue;
        }
        if (!get_show_item($dir, $items[$i])) {
            $error[$i] = $GLOBALS["error_msg"]["accessitem"];
            $err = true;
            continue;
        }
        // Delete
        $ok = remove(get_abs_item($dir, $items[$i]));
        if ($ok === false) {
            $error[$i] = $GLOBALS["error_msg"]["delitem"];
            $err = true;
            continue;
        }
        $error[$i] = NULL;
    }
    if ($err) {
        // there were errors
        $err_msg = "";
        for ($i = 0; $i < $cnt; ++$i) {
            if ($error[$i] == NULL) {
                continue;
            }
            $err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
        }
        show_error($err_msg);
    }
    miwoftp_redirect(make_link("list", $dir, NULL));
}
Beispiel #11
0
 public function getInfo()
 {
     $rawInfo = self::getRaw($this->action, $this->ref, $this->data);
     //import('SHD.simple_html_dom');
     $infoArray = parse_array($rawInfo['FILE'], '<tr>', '</tr>');
     $tr = [];
     $this->page = end($infoArray);
     foreach ($infoArray as $k => $v) {
         $tb = parse_array($v, '<td', '</td>');
         $temp = get_attribute($tb[7], 'href');
         $temp = split_string($temp, 'proj_idDes=', AFTER, EXCL);
         $tb[7] = remove($tb[7], '<a', '>');
         $tb[7] = remove($tb[7], '</a', '>');
         $temp2 = $tb[7];
         $tb[7] = [];
         $tb[7][] = $temp2;
         $tb[7][] = $temp;
         $temp4 = get_attribute($tb[8], 'href');
         $temp4 = split_string($temp4, 'proj_idDes=', AFTER, EXCL);
         $tb[8] = remove($tb[8], '<a', '>');
         $tb[8] = remove($tb[8], '</a', '>');
         $temp3 = $tb[8];
         $tb[8] = [];
         $tb[8][] = $temp3;
         $tb[8][] = $temp4;
         $tr[] = $tb;
         //parse_array($v,'<td','</td>');
         //var_dump($tr);
     }
     /*
              [4]=> array(9) { [0]=> string(37) "3" [1]=> string(30) "信息" [2]=> string(49) "201510613089 " [3]=> string(78) "基于人体肢体语言的机械臂操控" [4]=> string(62) "15国家创新训练项目" [5]=> string(45) "张翠芳" [6]=> string(185) "20132235 刘炳楠
     20132312 覃勇杰
     20132230 李晓芳
     20132169 涂敏
     " [7]=> string(145) "查看 " [8]=> string(158) " 成果展" }
     */
     /*$html=new simple_html_dom();
             $html->load($rawInfo["FILE"]);
             //var_dump($html);
     //return $rawInfo;
             $infoArray = $html->find('tr');*/
     return $tr;
 }
Beispiel #12
0
function remove($path)
{
    if (!file_exists($path)) {
        return true;
    }
    if (is_file($path)) {
        return unlink($path);
    }
    $d = dir($path);
    while ($e = $d->read()) {
        if ($e == '.' || $e == '..') {
            continue;
        }
        $nPath = $path . '/' . $e;
        remove($nPath);
    }
    $d->close();
    return rmdir($path);
}
Beispiel #13
0
function run_tests($filename, $test_cases)
{
    $code2test = read_src_file($filename . '_4test.pas');
    $count_pass = 0;
    $result = array(count($test_cases));
    foreach ($test_cases as $key => $value) {
        $result[$key] = test_result($key, $filename, $code2test);
        if ($result[$key] == $value) {
            $count_pass++;
        }
    }
    remove($filename);
    //Xoa tep chuong trinh
    remove($filename . '.o');
    //Xoa tep lien ket bien dich
    echo show_testing_result($test_cases, $result);
    if ($count_pass == count($test_cases)) {
        return true;
    }
    return false;
}
Beispiel #14
0
function process($argv)
{
    if (!isset($argv[1])) {
        displayHelp();
        exit;
    }
    switch ($argv[1]) {
        case 'install':
            install();
            break;
        case 'add':
            add($argv);
            break;
        case 'rm':
            remove($argv);
            break;
        case 'help':
        default:
            displayHelp();
            break;
    }
}
Beispiel #15
0
foreach ($html->find('div.views-field-field-image-cache-fid') as $image) {
    $books[$bookCount]['imageUrl'] = str_replace("www", "ftp", get_attribute($image->find('img', 0), 'src'));
    $bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-title') as $title) {
    $books[$bookCount]['title'] = trim($title->plaintext);
    $links = $title->find('a');
    foreach ($links as $link) {
        $books[$bookCount]['pageUrl'] = resolve_address($link->href, $page_base);
    }
    $bookPage = http_get($books[$bookCount]['pageUrl'], $target);
    $bookHTML = new simple_html_dom();
    $bookHTML->load($bookPage['FILE']);
    foreach ($bookHTML->find('div.product-body') as $summary) {
        $books[$bookCount]['summary'] = remove($summary->outertext, '<img', '/>');
    }
    $bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-field-author-value') as $author) {
    $books[$bookCount]['author'] = trim($author->plaintext);
    $bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-field-isbn13-value') as $isbn13) {
    $books[$bookCount]['ISBN13'] = trim($isbn13->plaintext);
    $bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-field-released-value') as $releasedDate) {
Beispiel #16
0
    }
}
if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
$GLOBALS["posix_getuid"] = 0;
include_once dirname(__FILE__) . '/ressources/class.users.menus.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/ressources/class.autofs.inc';
include_once dirname(__FILE__) . '/ressources/logs.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
$unix = new unix();
$GLOBALS["losetup"] = $unix->find_program("losetup");
if ($argv[1] == "--remove") {
    remove($argv[2]);
    die;
}
build();
function build()
{
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pid = @file_get_contents($pidfile);
    $unix = new unix();
    if ($unix->process_exists($pid)) {
        writelogs("Already process exists pid {$pid}", __FUNCTION__, __FILE__, __LINE__);
        echo "Already process exists pid {$pid}\n";
        return;
    }
    $mysqld = $unix->find_program("mysqld");
    if (!is_file($mysqld)) {
Beispiel #17
0
    exit;
}
if (isset($_GET["InstallLogs"])) {
    GetLogsStatus();
    exit;
}
if (isset($_GET["TestConnection-js"])) {
    TestConnection_js();
    exit;
}
if (isset($_GET["testConnection"])) {
    testConnection();
    exit;
}
if (isset($_GET["remove"])) {
    remove();
    exit;
}
if (isset($_GET["uninstall_app"])) {
    remove_perform();
    exit;
}
if (isset($_GET["remove-refresh"])) {
    remove_refresh();
    exit;
}
if (isset($_GET["ui-samba"])) {
    install_remove_services();
    exit;
}
if (isset($_GET["clear"])) {
<?php

require "settings.php";
if (isset($_REQUEST["key"])) {
    switch ($_REQUEST["key"]) {
        case "display":
            $OUTPUT = display();
            break;
        case "add":
            $OUTPUT = add();
            break;
        case "remove":
            $OUTPUT = remove();
            break;
    }
} else {
    $OUTPUT = display();
}
require "template.php";
function display()
{
    $sql = "SELECT id, reason FROM cubit.recon_reasons ORDER BY id DESC";
    $reason_rslt = db_exec($sql) or errDie("Unable to retrieve reasons.");
    $reason_out = "";
    while (list($id, $reason) = pg_fetch_array($reason_rslt)) {
        $reason_out .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>{$reason}</td>\n\t\t\t<td align='center'>\n\t\t\t\t<input type='checkbox' name='remove[{$id}]' value='{$id}'\n\t\t\t\tonchange='javascript:document.form.submit()' />\n\t\t\t</td>\n\t\t</tr>";
    }
    if (empty($reason_out)) {
        $reason_out = "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='2'><li>No reasons found.</li></td>\n\t\t</tr>";
    }
    $OUTPUT = "\n\t<h3>Recon Reasons</h3>\n\t<form method='post' action='" . SELF . "'>\n\t<input type='hidden' name='key' value='add' />\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th colspan='2'>Add</th>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td><input type='text' name='reason' /></td>\n\t\t\t<td><input type='submit' value='Add' /></td>\n\t\t</tr>\n\t</table>\n\t</form>\n\t<form method='post' action='" . SELF . "' name='form'>\n\t<input type='hidden' name='key' value='remove' />\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th>Reason</th>\n\t\t\t<th>Remove</th>\n\t\t</tr>\n\t\t{$reason_out}\n\t</table>\n\t</form>";
Beispiel #19
0
if(isset($_GET["software-list-by-family"])){software_available_family();exit;}

if(isset($_GET["software-list"])){software_list_by_family();exit;}

if(isset($_GET["main-start"])){echo popup_main();exit;}

if(isset($_GET["mysqlstatus"])){echo mysql_status();exit;}
if(isset($_GET["main"])){echo mysql_main_switch();exit;}
if(isset($_GET["mysqlenable"])){echo mysql_enable();exit;}
if($_GET["script"]=="mysql_enabled"){echo js_mysql_enabled();exit;}
if($_GET["script"]=="mysql_save_account"){echo js_mysql_save_account();exit;}
if(isset($_GET["install_app"])){install_app();exit;}
if(isset($_GET["InstallLogs"])){GetLogsStatus();exit;}
if(isset($_GET["TestConnection-js"])){TestConnection_js();exit;}
if(isset($_GET["testConnection"])){testConnection();exit;}
if(isset($_GET["remove"])){remove();exit;}
if(isset($_GET["uninstall_app"])){remove_perform();exit;}
if(isset($_GET["remove-refresh"])){remove_refresh();exit;}
if(isset($_GET["ui-samba"])){install_remove_services();exit;}
if(isset($_GET["clear"])){clear();exit;}
if(isset($_GET["SynSysPackages"])){SynSysPackages();exit;}
if(isset($_GET["softwares-available"])){software_available();exit;}
if(isset($_GET["remove-app-js"])){remove_app_js();exit;}
if(isset($_POST["remove-app-perform"])){remove_app_perform();exit;}
if(isset($_GET["RefreshMysqlSetup"])){RefreshMysqlSetup();exit;}

if(posix_getuid()<>0){main_page();}

function events_js(){
	$page=CurrentPageName();
	$tpl=new templates();
#
#
#
#
#
#
#
#
#
#
#
require "settings.php";
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "remove":
            $OUTPUT = remove($_POST);
            break;
        default:
            $OUTPUT = "Invalid use of script";
    }
} elseif (isset($_GET["id"])) {
    $OUTPUT = confirm($_GET);
} else {
    $OUTPUT = "Invalid use of script.";
}
$OUTPUT .= "\r\n\t\t\t\t<p>\r\n\t\t\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Quick Links</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td><a href='team-add.php'>Add Cubit Team</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td><a href='team-list.php'>View Cubit Teams</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<script>document.write(getQuicklinkSpecial());</script>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td><a href='index.php'>My Business</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>";
require "template.php";
function confirm($_GET)
{
    extract($_GET);
    $id += 0;
<?php

require_once '../init.php';
switch ($_POST['type']) {
    case 'add':
        add($_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['contactperson'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $_POST['ledgeraccountnumber'], $_POST['taxcode'], $db);
        break;
    case 'edit':
        break;
    case 'delete':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        remove($db, $_POST['id']);
        break;
}
function alert($string)
{
    echo '<script type="text/javascript">alert("' . $string . '");</script>';
}
function add($contact_name, $contact_lastname, $companyname, $first_adress, $first_zipcode, $first_city, $first_housenumber, $second_adress, $second_zipcode, $second_city, $second_housenumber, $contactperson, $initials, $first_telephonenumber, $second_telephonenumber, $fax, $email, $ledgeraccountnumber, $taxcode, $db)
{
    $controle = 2;
    $created_at = time();
    $sql = "SELECT * FROM tbl_customer WHERE companyname = :companyname";
    $q = $db->prepare($sql);
    $q->bindParam(':companyname', $companyname);
    $q->execute();
    // kijkt of de rij al bestaat
    if ($q->rowCount() > 0) {
        $exists = 'customer already exists';
        alert($exists);
        $controle = 1;
Beispiel #22
0
function remove($item)
{
    // remove file / dir
    if (!is_link($item)) {
        $item = realpath($item);
    }
    $ok = true;
    if (is_link($item) || is_file($item)) {
        $ok = unlink($item);
    } elseif (@is_dir($item)) {
        if (($handle = opendir($item)) === false) {
            ext_Result::sendResult('delete', false, basename($item) . ": " . $GLOBALS["error_msg"]["opendir"]);
        }
        while (($file = readdir($handle)) !== false) {
            if ($file == ".." || $file == ".") {
                continue;
            }
            $new_item = $item . "/" . $file;
            if (!file_exists($new_item)) {
                ext_Result::sendResult('delete', false, basename($item) . ": " . $GLOBALS["error_msg"]["readdir"]);
            }
            //if(!get_show_item($item, $new_item)) continue;
            if (@is_dir($new_item)) {
                $ok = remove($new_item);
            } else {
                $ok = unlink($new_item);
            }
        }
        closedir($handle);
        $ok = @rmdir($item);
    }
    return $ok;
}
function svn_export_group($group, $global, $base_dir, $singleGet = null)
{
    $revision = array();
    if ($group['get'][0] == '*') {
        $revision[$global['svn_repo'] . $group['svn_path']] = svn_export($global['svn_repo'] . $group['svn_path'], $global['svn_user'], $global['svn_pass'], $base_dir . $group['local_path']);
    } else {
        if ($singleGet) {
            $revision[$global['svn_repo'] . $group['svn_path'] . $singleGet] = svn_export($global['svn_repo'] . $group['svn_path'] . $singleGet, $global['svn_user'], $global['svn_pass'], $base_dir . $group['local_path'] . $singleGet);
        } else {
            foreach ($group['get'] as $current) {
                $revision[$global['svn_repo'] . $group['svn_path'] . $current] = svn_export($global['svn_repo'] . $group['svn_path'] . $current, $global['svn_user'], $global['svn_pass'], $base_dir . $group['local_path'] . $current);
            }
        }
    }
    if (isset($group['remove'])) {
        foreach ($group['remove'] as $current) {
            $folders_to_remove = get_folders_to_remove($base_dir . $group['local_path'], $current);
            //$path = explode(" * ", $current);
            foreach ($folders_to_remove as $folder) {
                remove($base_dir . $group['local_path'] . '/' . $folder);
            }
        }
    }
    return $revision;
}
Beispiel #24
0
    } else {
        if ($cmd == 'edit_action') {
            $user = get_logged_in_user();
            require_founder_login($user, $team);
            check_tokens($user->authenticator);
            $forum = BoincForum::lookup("parent_type=1 and category={$teamid}");
            if (!$forum) {
                error_page("No forum");
            }
            edit_action($forum);
        } else {
            if ($cmd == "remove_confirm") {
                $user = get_logged_in_user();
                require_founder_login($user, $team);
                remove_confirm($user, $team);
            } else {
                if ($cmd == "remove") {
                    $user = get_logged_in_user();
                    require_founder_login($user, $team);
                    remove($team);
                } else {
                    if ($cmd != "") {
                        error_page("unknown command {$cmd}");
                    } else {
                        show_forum($team);
                    }
                }
            }
        }
    }
}
Beispiel #25
0
function remove($item)
{
    $item = realpath($item);
    $ok = true;
    if (is_link($item) || is_file($item)) {
        $ok = unlink($item);
    } elseif (is_dir($item)) {
        if (($handle = opendir($item)) === false) {
            return false;
        }
        while (($file = readdir($handle)) !== false) {
            if ($file == ".." || $file == ".") {
                continue;
            }
            $new_item = $item . "/" . $file;
            if (!file_exists($new_item)) {
                return false;
            }
            if (is_dir($new_item)) {
                $ok = remove($new_item);
            } else {
                $ok = unlink($new_item);
            }
        }
        closedir($handle);
        $ok = @rmdir($item);
    }
    return $ok;
}
Beispiel #26
0
function directoryLink($link, $dir)
{
    remove($link);
    directory(dirname($link));
    directory($dir);
    symbolicLink($link, $dir);
}
Beispiel #27
0
if (!empty($_GET['mysql_server']['id'])) {
    if (!empty($data['view_available']) && count($data['view_available']) > 0) {
        ?>
        <div class="row">
            <div class="col-md-2">

                <?php 
        echo '<table class="table table-condensed table-bordered table-striped">';
        echo '<tr>';
        echo '<th>' . __("Reporting") . '</th>';
        echo '</tr>';
        echo '<tr>';
        echo '<td>';
        foreach ($data['view_available'] as $view) {
            //$url = $_GET['url'];
            $url = remove(array("mysqlsys"));
            if (!empty($_GET['mysqlsys']) && $view == $_GET['mysqlsys']) {
                echo '<a href="' . LINK . $url . '/mysqlsys:' . $view . '"><b>' . $view . '</b></a><br/>';
            } else {
                echo '<a href="' . LINK . $url . '/mysqlsys:' . $view . '">' . $view . '</a><br/>';
            }
        }
        echo '</td>';
        echo '</tr>';
        echo '</table>';
        ?>

            </div>
            <div class="col-md-10">
                <?php 
        $i = 0;
function remove_doubles($a)
{
    sort($a);
    $old = NULL;
    for ($loopi = 0; $loopi < count($a); $loopi++) {
        if ($old == $a[$loopi]) {
            /* if equal remove this element */
            $a = remove($a, $loopi);
            $loopi--;
        } else {
            $old = $a[$loopi];
        }
    }
    return $a;
}
Beispiel #29
0
function remove($item)
{
    // remove file / dir
    $ok = true;
    if (@is_link($item) || @is_file($item)) {
        $ok = @unlink($item);
    } elseif (@is_dir($item)) {
        if (($handle = @opendir($item)) === false) {
            show_error(basename($item) . ": " . $GLOBALS["error_msg"]["opendir"]);
        }
        while (($file = readdir($handle)) !== false) {
            if ($file == ".." || $file == ".") {
                continue;
            }
            $new_item = $item . "/" . $file;
            if (!@file_exists($new_item)) {
                show_error(basename($item) . ": " . $GLOBALS["error_msg"]["readdir"]);
            }
            //if(!get_show_item($item, $new_item)) continue;
            if (@is_dir($new_item)) {
                $ok = remove($new_item);
            } else {
                $ok = @unlink($new_item);
            }
        }
        closedir($handle);
        $ok = @rmdir($item);
    }
    return $ok;
}
Beispiel #30
0
                    //				echo "late with forms <br>";
                    deactivate($value["id"]);
                } else {
                    if (lateAssessment($value)) {
                        deactivate($value["id"]);
                    } else {
                        if (needAssessmentReminder($curr)) {
                            remind($curr);
                        }
                    }
                }
            }
            //store disabled users
            if ($value["activated"] == -1) {
                store($value["id"], $value["email"]);
                remove($value["id"]);
            }
        }
    }
}
function remind($curr)
{
    //update reminder value
    $assessments = getLastAssessment($curr);
    $update = QueryFactory::Build("update");
    $update->Table("assessments")->Where(["id", "=", $curr["id"]], ["TestNumber", "=", $assessments["TestNumber"]])->Set(["reminded", "1"]);
    $cinfo = DatabaseManager::Query($complete);
    //write email
    Mailer::Send($curr["email"], "This is an email reminder that your Sit And Be Fit assessment is due in a week./nPlease go to sbfresearch.org and login to complete the assessment");
}
function getLastAssessment($curr)