public function executeIndex(sfWebRequest $request) { $this->curUser = $this->getUser()->getGuardUser(); if ($this->curUser) { Cookie::setCookie($this->curUser, "index", Post::getNewLine('count'), time() + 24 * 60 * 60); Cookie::setCookie($this->curUser, "indexTime", date("Y-m-d H:i:s"), time() + 24 * 60 * 60); return; } $this->form = $this->applyForm(); if (!$request->isMethod('post')) { return; } sfApplicationConfiguration::getActive()->loadHelpers(array('Guid')); $this->form->bind($request->getParameter('sfApplyApply')); if ($this->form->isValid()) { $this->form->setValidate("n" . createGuid()); $this->form->save(); $this->getUser()->signin($this->form->getObject()->getUser(), true); $post = new Post(); $post->setText($this->getRequestParameter('text')); $post->setMoodName($this->getRequestParameter('mood')); $post->setUser($this->form->getObject()->getUser()); $post->save(); try { $mailer = $this->getMailer(); $profile = $this->form->getObject(); $mailContext = array('name' => $profile->getFullname(), 'validate' => $profile->getValidate(), 'partnerId' => $this->partnerId); $message = Swift_Message::newInstance(); $from = sfConfig::get('app_sfApplyPlugin_from'); $message->setFrom($from['email'], $from['fullname']); $message->setTo($profile->getEmail(), $profile->getUser()->getUsername()); $message->setSubject(sfConfig::get('app_sfApplyPlugin_apply_subject', "Активация аккаунта на сайте " . $request->getHost())); $message->setBody($this->getPartial('global/sendValidateNew', $mailContext), 'text/html'); $message->addPart($this->getPartial('global/sendValidateNewText', $mailContext), 'text/plain'); $mailer->send($message); } catch (Exception $e) { } return 'After'; } }
// "-" $uuid = chr(123) . substr($charid, 0, 8) . $hyphen . substr($charid, 8, 4) . $hyphen . substr($charid, 12, 4) . $hyphen . substr($charid, 16, 4) . $hyphen . substr($charid, 20, 12) . chr(125); // "}" return $uuid; } } $jk_corrid = NULL; if ($_SESSION["JK_CORR_SID"] == null) { $jk_corrid = createGuid(); $_SESSION["JK_CORR_SID"] = $jk_corrid; } else { $jk_corrid = $_SESSION["JK_CORR_SID"]; } $jk_rid = null; $jk_rid = createGuid(); $jk_pid = createGuid(); $_SESSION["JK_CORR_RID"] = $jk_rid; $_SESSION["JK_ZORKA_PARENT_ID"] = $jk_pid; $jk_ipAddress = $_SERVER["X-FORWARDED-FOR"]; $jk_usrName = $_SERVER['REMOTE_USER']; if ($jk_ipAddress == NULL) { $jk_ipAddress = $_SERVER["REMOTE_ADDR"]; } ?> <input type="hidden" name="corrid" id="corrid" value="<?php echo $jk_corrid; ?> "/> <input type="hidden" name="rcorrid" id="rcorrid" value="<?php echo $jk_rid; ?>
srand((double) microtime() * 1000000); $r = rand(); $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); $m = md5($u); return $m; } // duplicate module if (version_compare(mysql_get_server_info(), "4.0.14") >= 0) { $sql = "INSERT INTO " . $modx->getFullTableName("site_modules") . " (name, description, disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, guid, enable_sharedparams, properties, modulecode) \n\t\t\tSELECT CONCAT('Duplicate of ',name) AS 'name', description, disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '" . createGUID() . "' as 'guid', enable_sharedparams, properties, modulecode \n\t\t\tFROM " . $modx->getFullTableName("site_modules") . " WHERE id={$id};"; $rs = mysql_query($sql); } else { $sql = "SELECT CONCAT('Duplicate of ',name) AS 'name', description, disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, guid, enable_sharedparams, properties, modulecode \n\t\t\tFROM " . $modx->getFullTableName("site_modules") . " WHERE id={$id};"; $rs = mysql_query($sql); if ($rs) { $row = mysql_fetch_assoc($rs); $sql = "INSERT INTO " . $modx->getFullTableName("site_modules") . " \n\t\t\t\t(name, description, disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, guid, enable_sharedparams, properties, modulecode) VALUES \n\t\t\t\t('" . $modx->db->escape($row['name']) . "', '" . $modx->db->escape($row['description']) . "', " . $row['disabled'] . ", '" . $row['category'] . "', '" . $row['wrap'] . "', '" . $modx->db->escape($row['icon']) . "', '" . $modx->db->escape($row['enable_resource']) . "', '" . $modx->db->escape($row['resourcefile']) . "', '" . $row['createdon'] . "', '" . $row['editedon'] . "', '" . createGuid() . "', '" . $modx->db->escape($row['enable_sharedparams']) . "', '" . $modx->db->escape($row['properties']) . "', '" . $modx->db->escape($row['modulecode']) . "');"; $rs = mysql_query($sql); } } if ($rs) { $newid = mysql_insert_id(); } else { echo "A database error occured while trying to duplicate module: <br /><br />" . mysql_error(); exit; } // duplicate module dependencies if (version_compare(mysql_get_server_info(), "4.0.14") >= 0) { $sql = "INSERT INTO " . $modx->getFullTableName("site_module_depobj") . " (module, resource, type)\n\t\t\tSELECT '{$newid}', resource, type \n\t\t\tFROM " . $modx->getFullTableName("site_module_depobj") . " WHERE module={$id};"; $rs = mysql_query($sql); } else { $sql = "SELECT {$newid} as 'newid', resource, type \n\t\t\tFROM " . $modx->getFullTableName("site_module_depobj") . " WHERE module={$id};";
$lib_suffix = ".lib"; echo '<?xml version="1.0" encoding="gb2312"?>'; ?> <VisualStudioProject ProjectType="Visual C++" Version="<?php echo $VCPROJ_VERSION; ?> " Name="<?php echo $prjname; ?> " ProjectGUID="{<?php echo createGuid(); ?> }" > <Platforms> <Platform Name="<?php echo $platform; ?> " /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <?php