本文整理汇总了PHP中Utils类的典型用法代码示例。如果您正苦于以下问题:PHP Utils类的具体用法?PHP Utils怎么用?PHP Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Utils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createSettingsFile
public static function createSettingsFile($dbHostname, $dbName, $dbUsername, $dbPassword, $tablePrefix)
{
$encryptionSalt = Utils::generateRandomAlphanumericStr("DDD");
$dbUsername = Utils::sanitize($dbUsername);
$dbPassword = Utils::sanitize($dbPassword);
$tablePrefix = Utils::sanitize($tablePrefix);
$content = <<<END
<?php
\$dbHostname = '{$dbHostname}';
\$dbName = '{$dbName}';
\$dbUsername = '{$dbUsername}';
\$dbPassword = '{$dbPassword}';
\$dbTablePrefix = '{$tablePrefix}';
\$encryptionSalt = '{$encryptionSalt}';
END;
$file = __DIR__ . "/../../settings.php";
$handle = @fopen($file, "w");
if ($handle) {
fwrite($handle, $content);
fclose($handle);
return array(true, "");
}
// no such luck! we couldn't create the file on the server. The user will need to do it manually
return array(false, $content);
}
开发者ID:balmychan,项目名称:generatedata,代码行数:26,代码来源:Installation.class.php
示例2: signin
public function signin()
{
if ($this->get_request_method() != "POST") {
$this->response('', 406);
}
$email = $this->_request['email'];
$password = $this->_request['pwd'];
$db = new DB();
$ultis = new Utils();
// Input validations
if (!empty($email) and !empty($password)) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$sql = "SELECT _uid, _email FROM users WHERE _email = '{$email}' AND _password = '" . md5($password) . "' LIMIT 1";
$rs = $db->query($sql);
if ($rs->num_rows > 0) {
// If success return authenticated key (sample)
$result = array('access_token' => "633uq4t0qdtd1mdllnv2h1vs32");
$this->response($ultis->json($result), 200);
}
}
}
// If invalid inputs "Bad Request" status message and reason
$error = array('status' => "Failed", "msg" => "Invalid Email address or Password");
$this->response($ultis->json($error), 400);
}
开发者ID:nguyenanhdung83,项目名称:test_gotit,代码行数:25,代码来源:accounts.php
示例3: smarty_function_apretaste_email
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsFunction
*/
function smarty_function_apretaste_email($params, $template)
{
// get a valid apretaste email address
$utils = new Utils();
$validEmailAddress = $utils->getValidEmailAddress();
return $validEmailAddress;
}
开发者ID:ChrisClement,项目名称:Core,代码行数:13,代码来源:function.apretaste_email.php
示例4: login
public static function login($usu_usuario, $usu_contrasena)
{
$conn = new Connect();
$u = new Utils();
$query = 'SELECT * FROM ' . self::DB_TBL_USUARIO . ' WHERE usu_usuario = :usu_usuario';
$consult = $conn->prepare($query);
$consult->bindParam(':usu_usuario', $usu_usuario);
$consult->execute();
$row = $consult->fetch();
if ($consult->rowCount() > 0) {
$passValidate = $u->passValidate($usu_contrasena, $row['usu_contrasena']);
if ($passValidate == true) {
if ($row['usu_id_rol'] == 1) {
session_start();
$_SESSION['session'] = $row['usu_usuario'];
echo "<script>location.href='../../mod_admin/vista/administrador.php'</script>";
} else {
session_start();
$_SESSION['session'] = $row['usu_usuario'];
echo "<script>location.href='../../mod_admin/vista/tecnico.php'</script>";
}
} else {
echo "<script>alert('Error de autenticación. Por favor verifique sus credenciales de acceso.')</script>";
echo "<script>location.href = '../vista/form_login.php' </script>";
return false;
}
} else {
echo "<script>alert('Error de autenticación.')</script>";
echo "<script>location.href = '../vista/form_login.php' </script>";
return false;
}
}
开发者ID:racorrea,项目名称:ReservaVideoconferencias,代码行数:32,代码来源:AuthModel.php
示例5: execute
public function execute()
{
$utils = new Utils();
$c = new Convertor();
$c->connect($this->config->getServer(), $this->config->getUser(), $this->config->getPassword(), $this->config->getDBName());
//Requesting all the borough
$requestRue = "\n\t\t\t\tSELECT idRue ,nom , prefixe\n\t\t\t\tFROM rue\n\t\t\t\tWHERE nom != ''\n\t\t\t\tGROUP BY idRue\n\t\t\t\tORDER BY idRue\n\t\t\t\t";
$res = $c->execute($requestRue);
$listeQuartier = array();
$ruesByQuartier = array();
$i = 0;
while ($fetch = mysql_fetch_assoc($res)) {
$rue = array();
$rue['prefixe'] = $fetch['prefixe'];
$rue['nom'] = $fetch['nom'];
$request = "\n\t\t\t\t\tSELECT hi.idHistoriqueImage, hi.dateUpload\n\t\t\t\t\tFROM _evenementImage ei\n\t\t\t\t\tLEFT JOIN _evenementEvenement ee on ee.idEvenementAssocie = ei.idEvenement\n\t\t\t\t\tLEFT JOIN _adresseEvenement ae on ae.idEvenement = ee.idEvenement\n\t\t\t\t\tLEFT JOIN historiqueAdresse ha on ha.idAdresse = ae.idAdresse\n\t\t\t\t\tLEFT JOIN historiqueImage hi on hi.idImage = ei.idImage\n\t\t\t\t\tWHERE ha.idRue = " . $fetch['idRue'] . "\n\t\t\t\t\t\t\t";
$resProcess = $c->processRequest($request, 'url');
$j = 0;
$urlImage = array();
foreach ($resProcess as $infoImage) {
$indice = 'url' . $j++;
$urlImage[$indice] = $utils->createArchiWikiPhotoUrl($infoImage['idHistoriqueImage'], $infoImage['dateUpload'], 'http://archi-strasbourg.org', 'grand');
}
$rue['url'] = $urlImage;
$label = 'rue' . $i++;
$ruesByQuartier[$label] = $rue;
}
$c->complexArrayToXML($ruesByQuartier, "xml/urlPhotosRue.xml", 'urlPhotosRue', 'urlPhoto');
$c->complexArrayToCSV($ruesByQuartier, "csv/urlPhotosRue.csv", 'urlPhotosRue', 'urlPhoto');
}
开发者ID:archi-strasbourg,项目名称:archi-wiki,代码行数:30,代码来源:UrlPhotosRue.php
示例6: droppedAction
public function droppedAction()
{
// do not allow empty calls
if (empty($_POST)) {
die("EMPTY CALL");
}
// get the params from post
$email = $_POST['recipient'];
$domain = $_POST['domain'];
$reason = $_POST['reason'];
$code = isset($_POST['code']) ? $_POST['code'] : "";
$desc = isset($_POST['description']) ? str_replace("'", "", $_POST['description']) : "";
// do not save Spam as hardfail
if (stripos($desc, 'spam') !== false) {
$reason = "spam";
}
// mark as bounced if the email is part of the latest campaign
$connection = new Connection();
$campaign = $connection->deepQuery("\n\t\t\tSELECT campaign, email FROM (\n\t\t\t\tSELECT * FROM `campaign_sent`\n\t\t\t\tWHERE campaign = (SELECT id FROM campaign WHERE status='SENT' ORDER BY sending_date DESC LIMIT 1)\n\t\t\t) A WHERE email = '{$email}'");
if (count($campaign) > 0) {
// increase the bounce number for the campaign
$campaign = $campaign[0];
$connection->deepQuery("\n\t\t\t\tUPDATE campaign SET\tbounced=bounced+1 WHERE id={$campaign->campaign};\n\t\t\t\tUPDATE campaign_sent SET status='BOUNCED', date_opened=CURRENT_TIMESTAMP WHERE id={$campaign->campaign} AND email='{$email}'");
// unsubscribe from the list
$utils = new Utils();
$utils->unsubscribeFromEmailList($email);
}
// save into the database
$sql = "INSERT INTO delivery_dropped(email,sender,reason,code,description) VALUES ('{$email}','{$domain}','{$reason}','{$code}','{$desc}')";
$connection->deepQuery($sql);
// echo completion message
echo "FINISHED";
}
开发者ID:Apretaste,项目名称:Core,代码行数:33,代码来源:WebhookController.php
示例7: _main
/**
* Function executed when the service is called
*
* @param Request
* @return Response
* */
public function _main(Request $request)
{
// display help for an specific service
if (!empty($request->query)) {
// check if the query passed is a service
$connection = new Connection();
$res = $connection->deepQuery("SELECT * FROM service WHERE name = '{$request->query}'");
if (count($res) > 0) {
$service = $res[0];
// update the valid email on the usage text
$utils = new Utils();
$validEmailAddress = $utils->getValidEmailAddress();
$usage = str_replace('{APRETASTE_EMAIL}', $validEmailAddress, $service->usage_text);
// send variables to the template
$responseContent = array("name" => $service->name, "description" => $service->description, "category" => $service->category, "usage" => nl2br($usage));
// create response for an specific service
$response = new Response();
$response->subject = "Ayuda para el servicio " . ucfirst($service->name);
$response->createFromTemplate("service.tpl", $responseContent);
return $response;
}
}
// create response
$responseContent = array("userEmail" => $request->email);
$response = new Response();
$response->subject = "Ayuda de Apretaste";
$response->createFromTemplate("basic.tpl", $responseContent);
return $response;
}
开发者ID:Apretaste,项目名称:Sandbox,代码行数:35,代码来源:service.php
示例8: deployServiceFromZip
/**
* Extracts and deploys a new service to the service directory
*
* @param String $path, path to the zip file of the service
* @param String $deployKey, hash to avoid unauthorize updating of the service
* @return array, results of the deploy [serviceName, creatorEmail, deployKey]
*/
public function deployServiceFromZip($pathToZip, $deployKey, $zipName)
{
// extract file to the temp folder
$pathToService = $this->extractServiceZip($pathToZip);
$pathToXML = "{$pathToService}/config.xml";
// get the service data from the XML
$service = $this->loadFromXML($pathToXML);
// remove the current project if it exist
$utils = new Utils();
if ($utils->serviceExist($service['serviceName'])) {
// check if the deploy key is valid
if (!$this->checkDeployValidity($service['serviceName'], $deployKey)) {
throw new Exception("Deploy key is invalid");
}
// clean database and files if the service existed before
$this->removeService($service);
}
// create a new deploy key
$utils = new Utils();
$deployKey = $utils->generateRandomHash();
// add the new service
$this->addService($service, $deployKey, $pathToZip, $pathToService);
// remove temp service folder
@system("rmdir " . escapeshellarg($dir) . " /s /q");
// windows version
@system("rm -rfv " . escapeshellarg($pathToService));
// linux version
// return deploy results
return array("serviceName" => $service["serviceName"], "creatorEmail" => $service["creatorEmail"], "deployKey" => $deployKey);
}
开发者ID:ChrisClement,项目名称:Core,代码行数:37,代码来源:Deploy.php
示例9: mainAction
public function mainAction()
{
// inicialize supporting classes
$timeStart = time();
$connection = new Connection();
$email = new Email();
$service = new Service();
$service->showAds = true;
$render = new Render();
$response = new Response();
$utils = new Utils();
$wwwroot = $this->di->get('path')['root'];
$log = "";
// people who were invited but never used Apretaste
$invitedPeople = $connection->deepQuery("\n\t\t\tSELECT invitation_time, email_inviter, email_invited\n\t\t\tFROM invitations \n\t\t\tWHERE used=0 \n\t\t\tAND DATEDIFF(CURRENT_DATE, invitation_time) > 15 \n\t\t\tAND email_invited NOT IN (SELECT DISTINCT email from delivery_dropped)\n\t\t\tAND email_invited NOT IN (SELECT DISTINCT email from remarketing)\n\t\t\tORDER BY invitation_time DESC\n\t\t\tLIMIT 450");
// send the first remarketing
$log .= "\nINVITATIONS (" . count($invitedPeople) . ")\n";
foreach ($invitedPeople as $person) {
// check number of days since the invitation was sent
$datediff = time() - strtotime($person->invitation_time);
$daysSinceInvitation = floor($datediff / (60 * 60 * 24));
// validate old invitations to avoid bounces
if ($daysSinceInvitation > 60) {
// re-validate the email
$res = $utils->deepValidateEmail($person->email_invited);
// if response not ok or temporal, delete from invitations list
if ($res[0] != "ok" && $res[0] != "temporal") {
$connection->deepQuery("DELETE FROM invitations WHERE email_invited = '{$person->email_invited}'");
$log .= "\t --skiping {$person->email_invited}\n";
continue;
}
}
// send data to the template
$content = array("date" => $person->invitation_time, "inviter" => $person->email_inviter, "invited" => $person->email_invited, "expires" => strtotime('next month'));
// create html response
$response->createFromTemplate('pendinginvitation.tpl', $content);
$response->internal = true;
$html = $render->renderHTML($service, $response);
// send the invitation email
$subject = "Su amigo {$person->email_inviter} esta esperando por usted!";
$email->sendEmail($person->email_invited, $subject, $html);
// insert into remarketing table
$connection->deepQuery("INSERT INTO remarketing(email, type) VALUES ('{$person->email_invited}', 'INVITE')");
// display notifications
$log .= "\t{$person->email_invited}\n";
}
// get final delay
$timeEnd = time();
$timeDiff = $timeEnd - $timeStart;
// printing log
$log .= "EXECUTION TIME: {$timeDiff} seconds\n\n";
echo $log;
// saving the log
$logger = new \Phalcon\Logger\Adapter\File("{$wwwroot}/logs/remarketing_invitation.log");
$logger->log($log);
$logger->close();
// save the status in the database
$connection->deepQuery("UPDATE task_status SET executed=CURRENT_TIMESTAMP, delay='{$timeDiff}' WHERE task='invitation'");
}
开发者ID:Apretaste,项目名称:Core,代码行数:59,代码来源:InvitationTask.php
示例10: mainAction
public function mainAction()
{
// inicialize supporting classes
$timeStart = time();
$utils = new Utils();
$connection = new Connection();
$sender = new Email();
// get the first campaign created that is waiting to be sent
$campaign = $connection->deepQuery("\n\t\t\tSELECT id, subject, content\n\t\t\tFROM campaign\n\t\t\tWHERE sending_date < CURRENT_TIMESTAMP\n\t\t\tAND status = 'WAITING'\n\t\t\tGROUP BY sending_date ASC\n\t\t\tLIMIT 1");
// check if there are not campaigns
if (empty($campaign)) {
return;
} else {
$campaign = $campaign[0];
}
// check campaign as SENDING
$connection->deepQuery("UPDATE campaign SET status='SENDING' WHERE id = {$campaign->id}");
// get the list of people in the list who hsa not receive this campaign yet
// so in case the campaign fails when it tries again starts from the same place
$people = $connection->deepQuery("\n\t\t\tSELECT email FROM person\n\t\t\tWHERE mail_list=1 AND active=1\n\t\t\tAND email NOT IN (SELECT email FROM campaign_sent WHERE campaign={$campaign->id})");
// show initial message
$total = count($people);
echo "\nSTARTING COUNT: {$total}\n";
// email people one by one
$counter = 1;
foreach ($people as $person) {
// show message
echo "{$counter}/{$total} - {$person->email}\n";
$counter++;
// replace the template variables
$content = $utils->campaignReplaceTemplateVariables($person->email, $campaign->content, $campaign->id);
// send test email
$sender->trackCampaign = $campaign->id;
$result = $sender->sendEmail($person->email, $campaign->subject, $content);
// add to bounced and unsubscribe if there are issues sending
$bounced = "";
$status = "SENT";
if (!$result) {
$utils->unsubscribeFromEmailList($person->email);
$bounced = "bounced=bounced+1,";
$status = "BOUNCED";
}
// save status before moving to the next email
$connection->deepQuery("\n\t\t\t\tINSERT INTO campaign_sent (email, campaign, status) VALUES ('{$person->email}', '{$campaign->id}', '{$status}');\n\t\t\t\tUPDATE campaign SET {$bounced} sent=sent+1 WHERE id='{$campaign->id}'");
}
// set the campaign as SENT
$connection->deepQuery("UPDATE campaign SET status='SENT' WHERE id='{$campaign->id}'");
// get final delay
$timeEnd = time();
$timeDiff = $timeEnd - $timeStart;
// saving the log
$wwwroot = $this->di->get('path')['root'];
$logger = new \Phalcon\Logger\Adapter\File("{$wwwroot}/logs/campaigns.log");
$logger->log("ID: {$campaign->id}, RUNTIME: {$timeDiff}, SUBJECT: {$campaign->subject}");
$logger->close();
// save the status in the database
$connection->deepQuery("UPDATE task_status SET executed=CURRENT_TIMESTAMP, delay='{$timeDiff}' WHERE task='campaign'");
}
开发者ID:Apretaste,项目名称:Core,代码行数:58,代码来源:CampaignTask.php
示例11: up
public function up()
{
$this->dbforge->add_field(array('id_program_area' => array('type' => 'INT', 'auto_increment' => true), 'area_name' => array('type' => 'varchar(100)')));
$this->dbforge->add_key('id_program_area', TRUE);
$this->dbforge->create_table('program_area', TRUE);
$addColumn = "ALTER TABLE program ADD id_area INT NULL DEFAULT NULL , ADD INDEX (id_area)";
$this->db->query($addColumn);
$addConstraint = "ALTER TABLE program ADD CONSTRAINT PROGRAM_AREAID_FK FOREIGN KEY (id_area) REFERENCES program_area(id_program_area) ON DELETE RESTRICT ON UPDATE RESTRICT";
$this->db->query($addConstraint);
$populate = new Utils();
$populate->loadAvaliationAreas();
}
开发者ID:kailIII,项目名称:SiGA,代码行数:12,代码来源:062_cria_tabela_area_avaliacao.php
示例12: mainAction
public function mainAction()
{
// inicialize supporting classes
$timeStart = time();
$connection = new Connection();
$email = new Email();
$service = new Service();
$service->showAds = true;
$render = new Render();
$response = new Response();
$utils = new Utils();
$wwwroot = $this->di->get('path')['root'];
$log = "";
// people in the list to be automatically invited
$people = $connection->deepQuery("\n\t\t\tSELECT * FROM autoinvitations\n\t\t\tWHERE email NOT IN (SELECT email FROM person)\n\t\t\tAND email NOT IN (SELECT DISTINCT email FROM delivery_dropped)\n\t\t\tAND email NOT IN (SELECT DISTINCT email from remarketing)\n\t\t\tAND error=0\n\t\t\tLIMIT 450");
// send the first remarketing
$log .= "\nAUTOMATIC INVITATIONS (" . count($people) . ")\n";
foreach ($people as $person) {
// if response not ok, check the email as error
$res = $utils->deepValidateEmail($person->email);
if ($res[0] != "ok") {
$connection->deepQuery("UPDATE autoinvitations SET error=1, processed=CURRENT_TIMESTAMP WHERE email='{$person->email}'");
$log .= "\t --skiping {$person->email}\n";
continue;
}
// create html response
$content = array("email" => $person->email);
$response->createFromTemplate('autoinvitation.tpl', $content);
$response->internal = true;
$html = $render->renderHTML($service, $response);
// send invitation email
$subject = "Dos problemas, y una solucion";
$email->sendEmail($person->email, $subject, $html);
// mark as sent
$connection->deepQuery("\n\t\t\t\tSTART TRANSACTION;\n\t\t\t\tDELETE FROM autoinvitations WHERE email='{$person->email}';\n\t\t\t\tINSERT INTO remarketing(email, type) VALUES ('{$person->email}', 'AUTOINVITE');\n\t\t\t\tCOMMIT;");
// display notifications
$log .= "\t{$person->email}\n";
}
// get final delay
$timeEnd = time();
$timeDiff = $timeEnd - $timeStart;
// printing log
$log .= "EXECUTION TIME: {$timeDiff} seconds\n\n";
echo $log;
// saving the log
$logger = new \Phalcon\Logger\Adapter\File("{$wwwroot}/logs/remarketing_autoinvitation.log");
$logger->log($log);
$logger->close();
// save the status in the database
$connection->deepQuery("UPDATE task_status SET executed=CURRENT_TIMESTAMP, delay='{$timeDiff}' WHERE task='autoinvitation'");
}
开发者ID:Apretaste,项目名称:Core,代码行数:51,代码来源:AutoinvitationTask.php
示例13: processAction
/**
* Process the page when its submitted
*
* @author kuma, salvipascual
* @version 1.0
* */
public function processAction()
{
// get the values from the post
$captcha = trim($this->request->getPost('captcha'));
$name = trim($this->request->getPost('name'));
$inviter = trim($this->request->getPost('email'));
$guest = trim($this->request->getPost('guest'));
if (!isset($_SESSION['phrase'])) {
$_SESSION['phrase'] = uniqid();
}
// throw a die()
// check all values passed are valid
if (strtoupper($captcha) != strtoupper($_SESSION['phrase']) || $name == "" || !filter_var($inviter, FILTER_VALIDATE_EMAIL) || !filter_var($guest, FILTER_VALIDATE_EMAIL)) {
die("Error procesando, por favor valla atras y comience nuevamente.");
}
// params for the response
$this->view->name = $name;
$this->view->email = $inviter;
// create classes needed
$connection = new Connection();
$email = new Email();
$utils = new Utils();
$render = new Render();
// do not invite people who are already using Apretaste
if ($utils->personExist($guest)) {
$this->view->already = true;
return $this->dispatcher->forward(array("controller" => "invitar", "action" => "index"));
}
// send notification to the inviter
$response = new Response();
$response->setResponseSubject("Gracias por darle internet a un Cubano");
$response->setEmailLayout("email_simple.tpl");
$response->createFromTemplate("invitationThankYou.tpl", array('num_notifications' => 0));
$response->internal = true;
$html = $render->renderHTML(new Service(), $response);
$email->sendEmail($inviter, $response->subject, $html);
// send invitations to the guest
$response = new Response();
$response->setResponseSubject("{$name} le ha invitado a revisar internet desde su email");
$responseContent = array("host" => $name, "guest" => $guest, 'num_notifications' => 0);
$response->createFromTemplate("invitation.tpl", $responseContent);
$response->internal = true;
$html = $render->renderHTML(new Service(), $response);
$email->sendEmail($guest, $response->subject, $html);
// save all the invitations into the database at the same time
$connection->deepQuery("INSERT INTO invitations (email_inviter,email_invited,source) VALUES ('{$inviter}','{$guest}','abroad')");
// redirect to the invite page
$this->view->message = true;
return $this->dispatcher->forward(array("controller" => "invitar", "action" => "index"));
}
开发者ID:Apretaste,项目名称:Core,代码行数:56,代码来源:InvitarController.php
示例14: fieldControl
public static function fieldControl($field, array $fields, $default = '')
{
if (Utils::in_arrayi($field, $fields)) {
return $field;
}
return $default;
}
开发者ID:RoxasShadow,项目名称:nerdz.eu,代码行数:7,代码来源:security.class.php
示例15: action
public function action()
{
if (!isset($this->parameters->teamInfo)) {
Utils::forDebug($this->parameters, true);
}
return $actionResult = $this->install(isset($this->parameters->teamInfo) ? $this->parameters->teamInfo : NULL);
}
开发者ID:rootree,项目名称:vk-footboller-server,代码行数:7,代码来源:WelcomeController.php
示例16: testMarshalling
public function testMarshalling()
{
$attributeQuery = new AttributeQuery();
$attributeQuery->setNameID(array('Value' => 'NameIDValue'));
$attributeQuery->setAttributes(array('test1' => array('test1_attrv1', 'test1_attrv2'), 'test2' => array('test2_attrv1', 'test2_attrv2', 'test2_attrv3'), 'test3' => array()));
$attributeQueryElement = $attributeQuery->toUnsignedXML();
// Test Attribute Names
$attributes = Utils::xpQuery($attributeQueryElement, './saml_assertion:Attribute');
$this->assertCount(3, $attributes);
$this->assertEquals('test1', $attributes[0]->getAttribute('Name'));
$this->assertEquals('test2', $attributes[1]->getAttribute('Name'));
$this->assertEquals('test3', $attributes[2]->getAttribute('Name'));
// Test Attribute Values for Attribute 1
$av1 = Utils::xpQuery($attributes[0], './saml_assertion:AttributeValue');
$this->assertCount(2, $av1);
$this->assertEquals('test1_attrv1', $av1[0]->textContent);
$this->assertEquals('test1_attrv2', $av1[1]->textContent);
// Test Attribute Values for Attribute 2
$av2 = Utils::xpQuery($attributes[1], './saml_assertion:AttributeValue');
$this->assertCount(3, $av2);
$this->assertEquals('test2_attrv1', $av2[0]->textContent);
$this->assertEquals('test2_attrv2', $av2[1]->textContent);
$this->assertEquals('test2_attrv3', $av2[2]->textContent);
// Test Attribute Values for Attribute 3
$av3 = Utils::xpQuery($attributes[2], './saml_assertion:AttributeValue');
$this->assertCount(0, $av3);
}
开发者ID:SysBind,项目名称:saml2,代码行数:27,代码来源:AttributeQueryTest.php
示例17: control
public function control()
{
$this->redirectToSternIndiaEndpoint('forgot.php');
$config = Config::getInstance();
//$this->addToView('is_registration_open', $config->getValue('is_registration_open'));
// if (isset($_POST['email']) && $_POST['Submit'] == 'Send Reset') {
// /$_POST['email'] = '[email protected]';
if (isset($_POST['email'])) {
$this->disableCaching();
$dao = DAOFactory::getDAO('UserDAO');
$user = $dao->getByEmail($_POST['email']);
if (isset($user)) {
$token = $user->setPasswordRecoveryToken();
$es = new ViewManager();
$es->caching = false;
//$es->assign('apptitle', $config->getValue('app_title_prefix')."ThinkUp" );
$es->assign('first_name', $user->first_name);
$es->assign('recovery_url', "session/reset.php?token={$token}");
$es->assign('application_url', Utils::getApplicationURL(false));
$es->assign('site_root_path', $config->getValue('site_root_path'));
$message = $es->fetch('_email.forgotpassword.tpl');
$subject = $config->getValue('app_title_prefix') . "Stern India Password Recovery";
//Will put the things in queue to mail the things.
Resque::enqueue('user_mail', 'Mailer', array($_POST['email'], $subject, $message));
$this->addToView('link_sent', true);
} else {
$this->addErrorMessage('Error: account does not exist.');
}
}
$this->setViewTemplate('Session/forgot.tpl');
return $this->generateView();
}
开发者ID:prabhatse,项目名称:olx_hack,代码行数:32,代码来源:class.ForgotPasswordController.php
示例18: manipulateValues
function manipulateValues($column)
{
$field = Utils::findField($column);
if ($column == "date_date") {
$_POST[$column] = Utils::dateEn($_POST[$column]);
}
}
开发者ID:WebPassions,项目名称:2015,代码行数:7,代码来源:utils.class.php
示例19: display
public static function display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems)
{
$strResult = "<br>";
$strResult .= "<table id='tblist' width='100%' border='0' style='border:solid 1px #D3D3D3;' cellpadding='0' cellspacing='0'>";
//$strResult.= "<tr style='height:20px; font-weight:bold; font-size:10px; background:#8BC5F4;'>Name</tr>";
//$strResult.= "<tr style='height:36px; font-weight:bold; font-size:13px; background:#8BC5F4;'>NoiDung</tr>";
//$strResult.= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>idconnect</td>";
//$strResult.= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>NoiDung</td></tr>";
//$strResult.= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>Name</td>";
for ($i = 0; $i < count($business); $i++) {
$images = "select* from phongthuy";
//div style="margin-left: 10px; margin-top: 10px; font-family: tahoma; font-size: 18px;
// font-weight: bold; color:#890C29; text-transform:uppercase;">
$strResult .= "<table>";
$strResult .= "<tr><div><a href='chitietphongthuy.php?idphongthuy=" . $business[$i]['id'] . "'><b style='font-size:14px;font-weight:bold;color: #006DB9;'>" . $business[$i]['Name'] . " </b></a></div></tr>";
$strResult .= "<tr>";
$strResult .= "</br>";
//$strResult.="<tr>";
//$strResult.="<img src='../images/phongthuy/".$business[$i]['HinhAnh']."'>";
$strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'> <img width='70px' heigh='70px' src='../images/phongthuy/" . $business[$i]['HinhAnh1'] . "' style='vertical-align: middle;'/></td>";
//$strResult.= echo $business[$i]['HinhAnh'] ;
//$strResult.="<a href='chitietphongthuy.php?id=".$business[$i]['id']."'><img src='../".$images[0]['path']."' width='150px' /></a></td>";
$strResult .= "<td style='padding:4px;' width='450px'>" . $business[$i]['NoiDung'] . " </td>";
$strResult .= "</tr>";
$strResult .= "</table>";
$strResult .= "</br>";
$strResult .= "</br>";
}
$strPaging = Utils::paging($strLink, $totalItems, $curPage, $maxPages, $maxItems);
$strResult .= $strPaging;
$strResult .= "</table>";
return $strResult;
//echo $strPaging;
}
开发者ID:edconan93,项目名称:real-estate-website,代码行数:34,代码来源:phongthuyBUS.php
示例20: doesTextMatchImage
/**
* Check the $_POST'ed CAPTCHA inputs match the contents of the CAPTCHA.
* @return bool
*/
public function doesTextMatchImage()
{
//if in test mode, assume check is good if user_code is set to 123456
if (Utils::isTest()) {
if (isset($_POST['user_code']) && $_POST['user_code'] == '123456') {
return true;
} else {
return false;
}
}
switch ($this->type) {
case self::RECAPTCHA_CAPTCHA:
$config = Config::getInstance();
$priv_key = $config->getValue('recaptcha_private_key');
$resp = recaptcha_check_answer($priv_key, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
return false;
} else {
return true;
}
break;
default:
if (strcmp(md5($_POST['user_code']), SessionCache::get('ckey'))) {
return false;
} else {
return true;
}
break;
}
}
开发者ID:prabhatse,项目名称:olx_hack,代码行数:34,代码来源:class.Captcha.php
注:本文中的Utils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论