function getPassword_decrypt()
{
    // GET PASSWORD
    $serverAccess = true;
    include_once 'other/password_chat.php';
    // DECRYP
    $salt = 'apPH7dAD';
    $password = simple_decrypt($password, $salt);
    //RETURN PASSWORD
    return $password;
}
define("ENCRYPTION_KEY", "thisisaloudofbull");
function simple_encrypt($text, $salt)
{
    return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
}
function simple_decrypt($text, $salt)
{
    return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
}
/*****************salesforce*******************/
require_once PATH . '/includes/salesforce/SforcePartnerClient.php';
$sf_connect = false;
try {
    $mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection(PATH . "/includes/salesforce/partner.wsdl.xml");
    $mylogin = $mySforceConnection->login("*****@*****.**", simple_decrypt('1wDiGNrvb0Wnu4YlKnag4jiY6jNmsSB+CzBdMO7JOVw=', ENCRYPTION_KEY) . 'XLXKi5uo7dyODWL3E70ZoUc7h');
    $sf_connect = true;
} catch (Exception $e) {
    $sf_connect = false;
}
/*****************sendmail*******************/
function sendMail($email, $subject, $msg = NULL)
{
    $message = '';
    if ($msg == NULL) {
        $msg = $this->contents;
    }
    $message .= $msg;
    $message = wordwrap($message, 70);
    $mail = new PHPMailer();
    //    $mail->IsSMTP(); // Use SMTP
Example #3
0
        if ($liOpt == "B" || $liOpt == "C") {
            $liOptSvc = $liUser->option['sys'];
            if ($liOptSvc == "sms") {
                $liOptStr = simple_decrypt($liUser->option->sms['num']) . ($liUser->option->sms['sys'] == "A" ? "@txt.att.net" : '') . ($liUser->option->sms['sys'] == "V" ? "@vtext.com" : '') . ($liUser->option->sms['sys'] == "T" ? "@tmomail.net" : '');
            }
            if ($liOptSvc == "pbl") {
                $liOptStr = simple_decrypt($liUser->option->pushbul['eml']);
            }
            if ($liOptSvc == "pov") {
                $liOptStr = simple_decrypt($liUser->option->pushover['num']);
            }
            if ($liOptSvc == "bxc") {
                $liOptStr = simple_decrypt($liUser->option->boxcar['num']);
            }
        }
        $pagerline = array($liUid, $liUser->pager['sys'], simple_decrypt($liUser->pager['num']), $liOpt, $liOptSvc, $liOptStr);
        $liName = $liNameF . ' ' . $liNameL;
    }
    if ($liUser->pager['num']) {
        echo '<option value="' . simple_encrypt(implode(",", $pagerline)) . '" ' . ($liUid == $uid ? 'selected="selected"' : '') . '>' . $liName . '</option>' . "\r\n";
    }
}
?>
        </select>
        <label for="MYNAME">From:</label>
        <input type="text" name="MYNAME" id="MYNAME" value="" placeholder="REQUIRED" maxlength="20"/>
    </div>

    <div data-role="fieldcontain" style="text-align: right">
        <textarea name="MESSAGE" id="MESSAGE" maxlength="200"></textarea>
    </div>
Example #4
0
	$token = simple_encrypt($user->id, $app->enc_key);	
	$app->render(200,array('token' => $token));
});

//logout
$app->get('/logout', function() use($app) {
 	$token="";
	$app->render(200,array('token' => ''));

});
*/
//logout
$app->get('/logout', function () use($app) {
    $token = "";
    $app->render(200, array('token' => ''));
});
//perfil
$app->get('/me', function () use($app) {
    $token = $app->request->headers->get('auth-token');
    if (empty($token)) {
        $app->render(500, array('error' => TRUE, 'msg' => 'Not logged'));
    }
    $id_user_token = simple_decrypt($token, $app->enc_key);
    $user = User::find($id_user_token);
    if (empty($user)) {
        $app->render(500, array('error' => TRUE, 'msg' => 'Not logged'));
    }
    $app->render(200, array('data' => $user->toArray()));
});
$app->run();
Example #5
0
                        $ipaddress = 'UNKNOWN';
                    }
                }
            }
        }
    }
}
// **** SNPP server Info ****
//$ip = '63.172.11.60';
$ip = 'snpp.amsmsg.net';
$port = '444';
$success = 0;
// preset success to boolean false
// Get values from form page
$fromName = ucwords(trim(filter_input(INPUT_POST, 'MYNAME')));
$pinarray = explode(",", trim(simple_decrypt(filter_input(INPUT_POST, 'NUMBER'))));
// Pin Number from form page
$uid = $pinarray[0];
// recipient UID
$pagesys = $pinarray[1];
// Cook vs USA Mobility
$pin = $pinarray[2];
// pager number
$sendto = $pinarray[3];
// A:$pin, B:both, C:service
$sendSvc = $pinarray[4];
// extra service: sms,pbl,pov,bxc
$sendStr = $pinarray[5];
// user string
$messagePost = preg_replace("/\r\n/", " ", trim(filter_input(INPUT_POST, 'MESSAGE')));
// Get message from form page. Filter CR,LF
Example #6
0
$user = $edUserId ? $groups->xpath("//user[@uid='" . $edUserId . "']")[0] : '';
$nameL = $edUserId ? $user['last'] : '';
$nameF = $edUserId ? $user['first'] : '';
$sec = $edUserId ? $user['sec'] : '';
$numPager = $edUserId ? simple_decrypt($user->pager['num']) : '';
$numPagerSys = $edUserId ? $user->pager['sys'] : '';
$numSms = $edUserId ? simple_decrypt($user->option->sms['num']) : '';
$numSmsSys = $edUserId ? $user->option->sms['sys'] : '';
$numPushBul = $edUserId ? simple_decrypt($user->option->pushbul['eml']) : '';
$numProwl = $edUserId ? simple_decrypt($user->option->prowl['num']) : '';
$numPushOver = $edUserId ? simple_decrypt($user->option->pushover['num']) : '';
$numBoxcar = $edUserId ? simple_decrypt($user->option->boxcar['num']) : '';
$numSysOpt = $edUserId ? $user->option['mode'] : 'A';
$numNotifSys = $edUserId ? $user->option['sys'] : '';
$userCis = $edUserId ? simple_decrypt($user->auth['cis']) : '';
$userEml = $edUserId ? simple_decrypt($user->auth['eml']) : '';
$userGroup = $edUserId ? $user->xpath('..')[0] : '';
$userGroupName = $edUserId ? $userGroup->getName() : '';
$matchUser = $pageUser == $userCis ? true : false;
if (\filter_input(\INPUT_GET, 'move') == 'Y') {
    $moveway = \filter_input(\INPUT_POST, 'action');
    if ($moveway == 'up') {
        swapUser(\filter_input(\INPUT_POST, 'userPre'), $edUserId);
        $xml->asXML("list.xml");
    }
    if ($moveway == 'down') {
        swapUser($edUserId, \filter_input(\INPUT_POST, 'userFol'));
        $xml->asXML("list.xml");
    }
    $userP1 = $user->xpath("preceding-sibling::user[1]")[0];
    $userP1name = $userP1['sec'] ?: $userP1['last'] . ", " . $userP1['first'];
Example #7
0
            if (strcasecmp($userSort['last'] . ', ' . $userSort['first'], $nameL . ', ' . $nameF) > 0) {
                swapUser($userSort['uid'], $user['uid']);
                break;
            }
        }
        foreach ($groupfull as $grp => $grpStr) {
            $groups->{$grp} ?: $groups->addChild($grp);
            $domgrp = $groups->{$grp};
            $dom_All = dom_import_simplexml($groups[0]);
            $dom_grp = dom_import_simplexml($domgrp[0]);
            $dom_new = $dom_All->appendChild($dom_grp);
            simplexml_import_dom($dom_new);
        }
        if (strlen($show)) {
            mail(simple_decrypt($user->auth['eml']), "Heart Center Paging info changes to " . simple_decrypt($user->auth['cis']), "Changes were saved to your user account by " . filter_input(INPUT_COOKIE, 'pageuser') . ". The current settings are:\r\n" . $show, "Bcc: pedcards@uw.edu");
            logger($userauth . ' changed ' . simple_decrypt($user->auth['cis']) . ': ' . $show);
        }
        $xml->asXML("list.xml");
    }
}
function compare($field, $old, $new)
{
    if ($old == $new) {
        return '';
    } else {
        return $field . ": '" . $old . "' -> '" . $new . "'\r\n";
    }
}
if ($import) {
    // Read "list.csv" into array
    $imXml = new SimpleXMLElement("<root />");