Example #1
0
 public function pwdupdater($linker, $pwd)
 {
     $user_qry = sprintf("SELECT COUNT(id) as user_num FROM user WHERE auto_pwd = '%s' ", $linker);
     //$isUser = mysql_num_rows(mysql_query($user_qry));
     $user_res = mysql_fetch_assoc(mysql_query($user_qry));
     if (!$user_res) {
         $sent_data = "Oops!! something went wrong. Please try later";
     } else {
         if ($user_res['user_num'] == 1) {
             // updating
             $gen_pwd = updater::generateRandomString(10);
             $user_qry = sprintf("UPDATE user SET pwd = '%s', auto_pwd = '%s' WHERE auto_pwd = '%s' ", $pwd, $gen_pwd, $linker);
             //$isUser = mysql_num_rows(mysql_query($user_qry));
             $update_res = mysql_query($user_qry);
             if (!$update_res) {
                 $sent_data = "Oops!! something went wrong. Please try later";
             } else {
                 $sent_data = "ok";
             }
         } else {
             $sent_data = "expired";
         }
     }
     return $sent_data;
 }
Example #2
0
        }
        return $records;
    }
    /**
     * getNidsArrayArchive - get array of nodes in archive records
     */
    function setRightsItemPublic($nid)
    {
        $sql = "UPDATE biblio AS ba SET ba.biblio_custom1 = 'public domain' WHERE ba.nid = " . $nid . "";
        $this->dbi->update($sql);
        //echo $sql; echo "\n";
    }
    /**
     * getNidsArrayArchive - get array of nodes in archive records
     */
    function setRightsItemCopyright($nid)
    {
        $sql = "UPDATE biblio AS ba SET ba.biblio_custom1 = 'in copyright',  ba.biblio_custom2 = 'Permission to host granted on behalf of The East Africa Natural History Society', ba.biblio_custom3 = 'Attribution-NonCommercial-ShareAlike 3.0 Unported', ba.biblio_custom4 = 'http://creativecommons.org/licenses/by-nc-sa/3.0/' WHERE ba.nid = " . $nid . "";
        $this->dbi->update($sql);
        //echo $sql; echo "\n";
    }
}
$x = new updater();
$list = $x->getListPublic();
foreach ($list as $key => $nid) {
    $x->setRightsItemPublic($nid);
}
$listCopy = $x->getListCopy();
foreach ($listCopy as $key => $nid) {
    $x->setRightsItemCopyright($nid);
}
Example #3
0
<?php

include "../myDatabase.php";
include "updater.php";
$itemNo = $_GET['itemNo'];
$ro = new database();
$u = new updater();
for ($x = 0; $x < count($itemNo); $x++) {
    $registrationNo = $ro->selectNow("patientCharges", "registrationNo", "itemNo", $itemNo[$x]);
    $itemNo1 = $itemNo[$x];
    $shift = $ro->selectNow("patientCharges", "reportShift", "itemNo", $itemNo[$x]);
    $description = "OPD";
    $cashPaid = $ro->selectNow("patientCharges", "cashPaid", "itemNo", $itemNo[$x]);
    $orNo = $ro->selectNow("patientCharges", "orNO", "itemNo", $itemNo[$x]);
    $type = "OPD";
    $paidBy = $ro->selectNow("patientCharges", "paidBy", "itemNo", $itemNo[$x]);
    $timePaid = $ro->selectNow("patientCharges", "timePaid", "itemNo", $itemNo[$x]);
    $datePaid = $ro->selectNow("patientCharges", "datePaid", "itemNo", $itemNo[$x]);
    $paidVia = $ro->selectNow("patientCharges", "paidVia", "itemNo", $itemNo[$x]);
    $u->transferCollection($registrationNo, $itemNo1, $shift, $description, $cashPaid, $orNo, $type, $paidBy, $timePaid, $datePaid, $paidVia);
}
Example #4
0
<?php

include "updater.php";
$date = $_GET['date'];
$date1 = $_GET['date'];
$shift = $_GET['shift'];
$ro = new updater();
echo "<form method='get' action='" . $_SERVER['PHP_SELF'] . "'>";
echo "date <input type='text' name='date' value='{$date}'><br>";
echo "date1 <input type='text' name='date1' value='{$date1}'><br>";
echo "Shift <input type='text' name='shift' value='{$shift}'><br><Br>";
$ro->collectionReportToTransfer($date, $date1, $shift);
echo "</form>";
Example #5
0
 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS     |
 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT       |
 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT      |
 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   |
 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT        |
 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,   |
 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY   |
 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT     |
 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE   |
 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    |
 |                                                                         |
 +-------------------------------------------------------------------------+
*/
include "update_include.php";
$updater = new updater();
$updater->buildList();
//check for php version
$neededVer = "5.2.0";
$phpVer = phpversion();
if (floatval($neededVer) <= floatval($phpVer)) {
    $phpVerClass = "success";
} else {
    $phpVerClass = "fail";
}
//check to see if mysql plugin present
if (phpversion("mysql")) {
    $mysqlPresent = "success";
} else {
    $mysqlPresent = "fail";
}
Example #6
0
/* Updater Steps 
 * 1. get latest version from rconfig.com
 * 2. set or correct owner permissions to all /home/rconfig/ to apache account
 * 3. Assume correct version file uploaded and extract zip file completely to /home/rconfig/tmp/update-x.x.x/
 * 4. backup /home/rconfig/config/config.inc.php to updater files directory
 * 5. change version in config.inc.php to $latestVer
 * 6. Copy all from tmp update folder to prod rconfig folder
 * 7. Check installed version on config.inc.php 
 * 8. check for sql file in update tmp folder
 * 9. execute sql changes if file is present
 * 10. delete all tmp update files/folders using Linux rm command * 
 * 
 * */
// initiate classes
$log = ADLog::getInstance();
$update = new updater();
//Setting the timeout properly without messing with ini values:
$ctx = stream_context_create(array('http' => array('timeout' => 5)));
// here we assume we can already connect to net as ../www/updater.php will not allow us to proceed to this point i.e. no error check
$latestVer = file_get_contents("http://www.rconfig.com/downloads/version.txt", 0, $ctx);
$updateFileName = 'rconfig-' . $latestVer . '.zip';
$updateFile = $config_temp_dir . $updateFileName;
//extracted files path
$extractDir = '/home/rconfig/tmp/update-' . $latestVer;
// set json array for ultimate response to updater.php
$response = array();
// set chwon apache on /home/rconfig/ in case any are misconfigured
shell_exec('chown -R apache ' . $config_app_basedir);
// check if update file exists
if ($update->checkForUpdateFile($updateFile)) {
    if ($update->extractUpdate($updateFile, $extractDir)) {
Example #7
0
if (empty($_REQUEST["release"]) and empty($_REQUEST["cfile"]) or !sys_validate_token()) {
    updater::show_list($mirror_id);
} else {
    if (!empty($_REQUEST["cfile"])) {
        $source = $_REQUEST["cfile"];
        if (!file_exists($source) or filesize($source) < 3 * 1048576) {
            sys_die(t("{t}Error{/t}") . ": file-check [0] " . $source);
        }
    } else {
        $release = $_REQUEST["release"];
        if ($release == "latest" or !is_numeric($release)) {
            $data = @file_get_contents($mirror["url"]);
            $match = array();
            preg_match($mirror["pattern"], $data, $match);
            if (empty($match[1])) {
                sys_die(t("{t}Error{/t}") . ": file-check " . $mirror["url"]);
            }
            $release = $match[1];
        }
        $source = sprintf($mirror["source"], $release, $release);
    }
}
$temp_folder = SIMPLE_CACHE . "/updater/";
sys_mkdir($temp_folder);
$target = $temp_folder . substr(basename($source), 0, -3);
updater::download($source, $target);
$source_folder = updater::extract($target, $temp_folder);
updater::move_files($move_folders, $source_folder);
updater::extensions();
updater::footer();
Example #8
0
$holidays[] = strtotime("2014-04-18");
$holidays[] = strtotime("2014-05-26");
$holidays[] = strtotime("2014-07-04");
$holidays[] = strtotime("2015-01-01");
$today = strtotime(date("Y-m-d"));
if (!in_array($today, $holidays)) {
    $day = date('N');
    if ($day > 5) {
        echo "SKIP! WEEKEND - " . $day;
    } else {
        $hour = date('G');
        if ($hour < $PST_START || $hour >= $PST_END) {
            echo "SKIP! OFF HOURS - " . $hour;
        } else {
            //Include the PS_Pagination class
            $updater = new updater();
            $updater->update();
            echo "\ncomplete";
        }
    }
} else {
    echo "\n SKIP! HOLIDAY";
}
/*
$hour = intval(date('G'));
$minutes = intval(date('i'));
if ($hour == 6 && $minutes == 00){
		echo "\n SKIP! HOLIDAY";
			
	
		// SEND THE EXPIRING EMAIL TO THE expiring users