function setDefaultPost($blogid, $userid) { requireModel('blog.entry'); $entry = array(); $entry['category'] = 0; $entry['visibility'] = 2; $entry['location'] = '/'; $entry['tag'] = ''; $entry['title'] = _t('환영합니다!'); $entry['slogan'] = 'welcome'; $entry['contentformatter'] = 'ttml'; $entry['contenteditor'] = 'tinyMCE'; $entry['starred'] = 0; $entry['acceptcomment'] = 1; $entry['accepttrackback'] = 1; $entry['published'] = null; $entry['firstEntry'] = true; $entry['content'] = getDefaultPostContent(); return addEntry($blogid, $entry, $userid); }
<? // LDAP - PHP interface for Wagtail // v0.2 include("config.php"); include("functions.php"); // Login dn and password set as cookies $login_dn = (isset( $_COOKIE['login_dn'] ) and $_COOKIE['login_dn']!="" )? $_COOKIE['login_dn'] : "anon"; $login_pass = isset( $_COOKIE['login_pass'] ) ? $_COOKIE['login_pass'] : null; $Command=$_REQUEST['Command']; $region=$_REQUEST['region']; // Need to set new cookies before any text sent if($_REQUEST['Command']=='Log In'){ $uid=$_REQUEST['uid']; $ldapuser=getUserFromUID($uid); $login_pass=$_REQUEST['pw']; // See if can bind with those values $ldapConn = ldap_connect($ldapServer); ldap_set_option( $ldapConn, LDAP_OPT_PROTOCOL_VERSION, 3 ); $ldapBind = ldap_bind($ldapConn,$ldapuser,$login_pass); if ($ldapBind){ setcookie('login_dn', $ldapuser); setcookie('login_pass', $login_pass); $login_dn=$ldapuser; $login_pass=$_REQUEST['pw']; } else{ print "Unable to connect to $ldapServer as $ldapuser with that password<p>"; }
if (isset($_POST['permalink']) && $_POST['permalink'] != '') { $entry['slogan'] = $_POST['permalink']; } else { if ($_POST['permalink'] == '') { $entry['slogan'] = ''; } } $entry['acceptcomment'] = empty($_POST['acceptcomment']) ? 0 : 1; $entry['accepttrackback'] = empty($_POST['accepttrackback']) ? 0 : 1; $entry['published'] = empty($_POST['published']) ? 0 : $_POST['published']; $entry['draft'] = 0; if (strpos($entry['slogan'], 'TCDraftPost') === 0) { $entry['slogan'] = $entry['title']; } if (empty($suri['id'])) { if ($id = addEntry($blogid, $entry)) { fireEvent('AddPost', $id, $entry); Setting::setBlogSetting('LatestEditedEntry_user' . getUserId(), $id, true); $result = array(); $result['error'] = ($id !== false) === true ? 0 : 1; $result['entryId'] = $id; Respond::PrintResult($result); exit; } } else { if ($id = updateEntry($blogid, $entry, $updateDraft)) { fireEvent('UpdatePost', $id, $entry); Setting::setBlogSetting('LatestEditedEntry_user' . getUserId(), $suri['id'], true); Respond::ResultPage(0); exit; }
<?php include_once "header.php"; include_once "editor.php"; ?> <?php $numEntries = getIndexNum(); $cookie = $_COOKIE['dertyn']; $storedcookie = getCookie(); if (checkCookie() && $_POST['checksubmit']) { $subject = strip_tags($_POST['subject']); $body = $_POST['body']; $draft = strip_tags($_POST['draft']); if (strlen($subject) > 0) { addEntry($subject, $body, $draft); echo "<p><img src=\"icon_accept.gif\" border=\"0\" /> entry posted.</p>"; } else { echo "<p><b>Please enter a title!</b></p>"; showUpdateForm($body); } } else { if (checkCookie()) { showUpdateForm(); } else { echo "please <a href=\"login.php\">login</a>."; } } ?> <?php
function addSection($menu) { global $cnInfoCentral; $security_matrix = " AND (security_grp = 'bALL'"; if ($_SESSION['bAdmin']) { $security_matrix .= " OR security_grp = 'bAdmin'"; } if ($_SESSION['bAddRecords']) { $security_matrix .= " OR security_grp = 'bAddRecords'"; } if ($_SESSION['bMenuOptions']) { $security_matrix .= " OR security_grp = 'bMenuOptions'"; } if ($_SESSION['bFinance']) { $security_matrix .= " OR security_grp = 'bFinance'"; } if ($_SESSION['bManageGroups']) { $security_matrix .= " OR security_grp = 'bManageGroups'"; } $security_matrix .= ")"; $query = "SELECT name, ismenu, content, uri, statustext, session_var, session_var_in_text, session_var_in_uri, url_parm_name, security_grp FROM menuconfig_mcf WHERE parent = '{$menu}' AND active=1 " . $security_matrix . " ORDER BY sortorder"; $rsMenu = mysql_query($query, $cnInfoCentral); $item_cnt = mysql_num_rows($rsMenu); $ptr = 1; while ($aRow = mysql_fetch_array($rsMenu)) { if (isset($aRow['admin_only']) & !$_SESSION['bAdmin']) { // hide admin menu } else { addEntry($aRow); } $ptr++; } }
function db_sddl_lookup($sqlStr, &$lNumEntries, &$entries) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $lNumEntries = 0; $entries = array(); $CI =& get_instance(); $query = $CI->db->query($sqlStr); $numRows = $query->num_rows(); if ($numRows > 0) { foreach ($query->result() as $row) { addEntry($lNumEntries, $entries, $row->sddlKey, $row->sddlValue); } } }
include_once "header.php"; ?> <?php $numEntries = getIndexNum(); $cookie = $_COOKIE['mindof']; $storedcookie = getCookie(); $twitter_update = gettwitterCheck(); $twitter_email = gettwitterEmail(); if (checkCookie()) { showUpdateForm(); } if (checkCookie() && stripslashes($_POST['checksubmit'])) { $update = strip_tags($_POST['update']); addEntry($update); if ($twitter_update == 1 && strlen($twitter_email) > 0) { $twit_update = stripslashes($_POST['update']); updateTwitter($update); } echo " <img src=\"icon_accept.gif\" border=\"0\" /> mindof updated. "; } showEntriesIndex($numEntries); echo "<a href=\"" . $siteUrl . "archive.php?pagenum=2\" class=\"box\">older »</a>"; ?> <?php include_once "footer.php"; ?>
Processing */ $perform = $_REQUEST['perform']; $prepare_change = $_REQUEST['prepare_change']; $NAME = $_REQUEST['NAME']; $FIRSTNAME = $_REQUEST['FIRSTNAME']; $PHONE = $_REQUEST['PHONE']; $ACCOUNT = $_REQUEST['ACCOUNT']; $TYPE = $_REQUEST['TYPE']; $ID = $_REQUEST['ID']; $status = $_REQUEST['status']; $text = "No action requested.<p> </p>"; if (isset($perform)) { if (!empty($perform)) { if (!strcmp($perform, "add")) { $text = "<p>" . addEntry() . "</p>"; } if (!strcmp($perform, "delete")) { $text = "<p>" . deleteEntry() . "</p>"; } if (!strcmp($perform, "change")) { $text = "<p>" . changeEntry() . "</p>"; } } } if (isset($status)) { if (!empty($status)) { $text = "<p>" . $status . "</p>" . $text; } } /* !--
if ($o_i >= 0) { $output[$o_i][1] .= $lines[$i] . "\n"; } } } if ($o_i == -1) { $output[0][0] = "Script"; $output[0][1] = $input; } } else { if ($method == "create") { if (empty($input)) { $method = ""; //blank out the method if the user hit create without entering any text - just pretend nothing ever happened } else { $entry = addEntry($input, $title, $desc); if (!is_null($entry)) { header('Location: ' . GMF_PATH . $entry->hash . '/' . $entry->editor_hash); die; } } } else { if ($method == "update") { if (!empty($_POST['hash']) && !empty($_POST['ehash'])) { $hash = $_POST['hash']; $editor_hash = $_POST['ehash']; $entry = updateEntry($hash, $editor_hash, $input, $title, $desc); header('Location: ' . GMF_PATH . $entry->hash . '/' . $entry->editor_hash); die; } }
$link = $result->link; $guid = $result->guid; $updateTime = date('c'); $content = $result->children($ns['content']); if ($content) { $description = $content; } addEntry($title, $description, $pubDate, $link, $guid, $id, $updateTime); } } elseif ($xml->entry) { foreach ($xml->entry as $result) { $title = $result->title; $description = $result->summary; $pubDate = $result->updated; $link = $result->link['href']; $guid = $result->id; $updateTime = date('c'); $content = $result->content; addEntry($title, $description, $pubDate, $link, $guid, $id, $updateTime); } } else { $title = "{$url} is not a valid rss or atom feed!"; $description = "{$url} is not a valid rss or atom feed!"; $content = "{$url} is not a valid rss or atom feed!"; $link = "{$url}"; $pubDate = date('c'); $updateTime = date('c'); $guid = $link . date('c'); addEntry($title, $description, $pubDate, $link, $guid, $id, $updateTime); } }
} if (isset($_GET['del'])) { try { $label = $class->getLabel((int) $_GET['del']); if ($label !== Entitled::ID_NOT_EXITS) { $ret = $class->delete((int) $_GET['del']); if ($ret === true) { deleteDynamicTranslation($label, $error_detected); $success_detected[] = str_replace('%label', $label, _T("Entitled %label was successfully removed")); } } } catch (RuntimeException $re) { $error_detected[] = $re->getMessage(); } } elseif (isset($_POST['new'])) { addEntry($class); } elseif (isset($_POST['mod'])) { modifyEntry(trim($_POST['mod']), $class); } // Show the list. $list = $class->getCompleteList(); $tpl->assign('entries', $list); } if (count($class->errors) > 0) { $error_detected = array_merge($error_detected, $class->errors); } /* Set template parameters and print. */ $tpl->assign('require_tabs', true); $tpl->assign('fields', $fields); $tpl->assign('error_detected', $error_detected); $tpl->assign('success_detected', $success_detected);
} } function infoFields() { $c = new Entry(); return $c->getFields(); } /* </functions> */ $action = Functions::get('action'); Functions::checkRights(__FILE__, $action, Functions::get('token')); switch ($action) { case 'fields_info': $data = infoFields(); break; case 'new': $data = addEntry(); break; case 'update': $data = updateEntry(Functions::get('id')); break; case 'info': $data = infoEntry(Functions::get('id')); break; case 'delete': $data = deleteEntry(Functions::get('id')); break; case 'customer_history': $data = getCustomerHistory(Functions::get('id')); break; case 'list': $data = listEntries();
<?php defined('_JEXEC') or die('Restricted access'); switch (JRequest::getVar('task')) { case 'add': addEntry(); break; default: displayGuestbook(); break; } function addEntry() { // Get reference to database object $db =& JFactory::getDBO(); // Get user id for recording with entry. $user =& JFactory::getUser(); $uid = $user->get('id'); // Get message and location from form posting values $fldMessage = JRequest::getVar('message'); // Strip away anything that could be code, carriage returns, and so on $fldMessage = preg_replace("/[^a-zA-Z0-9 .?!\$()\\'\"]/", "", $fldMessage); // Escape the message so it can be placed in the insert statement $fldMessage = "'" . $db->getEscaped($fldMessage) . "'"; $fldLocation = "'" . $db->getEscaped(JRequest::getVar('location')) . "'"; // Obtain userIP and store with entry for security reasons $userIp = "'" . $_SERVER['REMOTE_ADDR'] . "'"; $insertFields = "INSERT INTO #__guestbook " . "(message, created_by, location, userip) " . "VALUES (" . $fldMessage . "," . intval($uid) . "," . $fldLocation . "," . $userIp . ");"; $db->setQuery($insertFields, 0); $db->query(); echo "<h1>Thanks for the entry!</h1>";
$birthday = filter_input(INPUT_POST, 'birthday'); $errors = array(); //uses preg_replace to remove everything other than the numbers $phone = justNumbersPhone($phoneEntry); if (!validPhone($phone)) { //errors if phone is not valid $errors[] = 'Phone is not valid'; } if (count($errors) == 0) { //if there are no errors, upload the image $image = uploadImage(); if (empty($image)) { //if the image is empty, error message $errors[] = 'image could not be uploaded'; } if (addEntry($userid, $group, $fullname, $email, $address, $phone, $website, $birthday, $image)) { //add the entry and notify the user $results = 'New entry was successfully added to your address book'; } else { $results = 'New entry was not added, try again'; } } } ?> <center> <div class="text-success"> <h1>Add New Entry</h1><br /></div> <?php if (isset($errors) && count($errors) > 0) {
<?php include_once "header.php"; ?> <?php $cookie = $_COOKIE['mooshu']; $storedcookie = getCookie(); if (checkCookie()) { showUpdateForm(); } if (checkCookie() && stripslashes($_POST['checksubmit'])) { $url = strip_tags($_POST['url']); $id = addEntry($url); print "<hr />\n"; print "mooshu'd link: <a href=\"{$siteurl}/{$id}\">{$siteurl}/{$id}</a><hr />"; print "original link: <a href=\"{$url}\">{$url}</a><hr /><br />"; } showRecent(); ?> <?php include_once "footer.php"; ?>
$ipbegin[1] = $_POST["ipbegin2"]; $ipend[1] = $_POST["ipend2"]; $retries[1] = $_POST["retries2"]; $timeout[1] = $_POST["timeout2"]; $ipbegin[2] = $_POST["ipbegin3"]; $ipend[2] = $_POST["ipend3"]; $retries[2] = $_POST["retries3"]; $timeout[2] = $_POST["timeout3"]; deleteExistedContent(); for ($i = 0; $i < 3; $i++) { # code... if ($ipbegin[$i] != "" && $ipend[$i] != "") { # code... echo "The IP range from " . $ipbegin[$i], " to " . $ipend[$i] . " has been supplemented into XML configuration file."; echo "<br>"; addEntry($ipbegin[$i], $ipend[$i]); } } echo "<br>"; echo "<br>"; echo "System needs to take a while for synchorizaiton."; echo "<br>"; echo "<br>"; echo "<button onclick=closeWin()>Close</button>"; echo "<script>\nfunction closeWin() {\n\twindow.close();\n}\n</script>"; function deleteExistedContent() { $genericSnmpPath = $_SERVER["DOCUMENT_ROOT"] . "/vanguardhe/daemon_scr/daemon_db_init.php"; require_once $genericSnmpPath; // to initialize db $query_exist = "SELECT relname FROM pg_class \n\tWHERE relname = 'daemondiscoveryrange';";