<?php

echo update_page("PESSOAS", $this->controller, $form, $this->module);
<?php

echo update_page("USUÁRIOS", $this->controller, $form, $this->module);
Beispiel #3
0
<?php

/**
 * Created by  : PhpStorm.
 * User        : sam
 * Company     : Jeeble
 * Date        : 7/21/15
 * Time        : 10:38 AM
 */
require_once "assets/includes/includes.php";
confirm_pirate_auth_login();
if (!can_current_user("edit")) {
    redirect_to('index.php');
}
if (isset($_POST['savepage'])) {
    if (update_page($_POST['id'], $_POST['title'], $_POST['content'], $_POST['reqconf'], $_POST['state'], "public")) {
        redirect_to('index.php');
    }
}
$page = [];
if (isset($_GET['id'])) {
    $page = get_page($_GET['id']);
}
get_partial('header');
?>

    <div class="container">
        <form action="editpage.php" method="post">
            <div class="col-sm-6 col-sm-offset-3">
                <h1 class="page-header">Edit Page</h1>
                <div class="form-group">
<?php

echo update_page("SANTO", $this->controller, $form, $this->module);
Beispiel #5
0
            break;
    }
}
function update_info()
{
    print update_page_header("Drupal database update");
    print "<ol>\n";
    print "<li>Use this script to <b>upgrade an existing Drupal installation</b>.  You don't need this script when installing Drupal from scratch.</li>";
    print "<li>Before doing anything, backup your database. This process will change your database and its values, and some things might get lost.</li>\n";
    print "<li>Update your Drupal sources, check the notes below and <a href=\"update.php?op=update\">run the database upgrade script</a>.  Don't upgrade your database twice as it may cause problems.</p></li>\n";
    print "<li>Go through the various administration pages to change the existing and new settings to your liking.</li>\n";
    print "</ol>";
    print "Notes:";
    print "<ol>";
    print " <li>If you upgrade from Drupal 4.2.0, you have to create the <code>sessions</code> table manually before upgrading.  After you created the table, you'll want to log in and immediately continue the upgrade.  To create the <code>sessions</code> table, issue the following SQL command (MySQL specific example):<pre>CREATE TABLE sessions (\n  uid int(10) unsigned NOT NULL,\n  sid varchar(32) NOT NULL default '',\n  hostname varchar(128) NOT NULL default '',\n  timestamp int(11) NOT NULL default '0',\n  session text,\n  KEY uid (uid),\n  KEY sid (sid(4)),\n  KEY timestamp (timestamp));</pre></li>";
    print "</ol>";
    print update_page_footer();
}
if (isset($_GET["op"])) {
    include_once "includes/common.inc";
    // Access check:
    if ($access_check == 0 || $user->uid == 1) {
        update_page();
    } else {
        print update_page_header("Access denied");
        print "Access denied.  You are not authorized to access to this page.  Please log in as the user with user ID #1. If you cannot log-in, you will have to edit <code>update.php</code> to by-pass this access check; in that case, open <code>update.php</code> in a text editor and follow the instructions at the top.";
        print update_page_footer();
    }
} else {
    update_info();
}
Beispiel #6
0
$_content = "";
$index = "";
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case 'find':
            $pagename = $_POST['pagename'];
            list($_id, $_title, $_content) = find_page_by_name($pagename);
            $query = $db->query("DELETE FROM occurrence WHERE page_id = '{$_id}'");
            break;
        case 'edited':
            $edit_id = $_POST['edit_id'];
            $content = $_POST['content'];
            $content = stripcslashes($content);
            $content = mysql_real_escape_string($content);
            $edit_id = mysql_real_escape_string($edit_id);
            $msg = update_page($content, $edit_id);
            $index = Index($edit_id);
            // delete indexes for $_id
            // create indexes for $edit_id
            break;
    }
}
?>




<link href="../css/typeahead.css" rel="stylesheet">


<div id="page-wrapper">
Beispiel #7
0
    $message = delete_topic_test ( $id, $dbLink );
    break;
  }
case "DELETEtopic": // FAULT_3 WDM
  {
    delete_topic ( $id, $dbLink );
    break;
  }
case "addNewTopic":
  {
    add_new_topic ( $newTitle, $newParent, $newContext, $newOrder, $dbLink );
    break;
  }
case "commit":
  {
    update_page ( stripslashes($faqText), $pageId, $id, $dbLink );
    break;
  }
case "Update Topic":
  {
    $topicPublish = ( $topicPublish == "on" ) ? "y" : "n";
    
    update_topic ( $topicTitle, $topicContext, $topicParent, 
		   $topicOrder, $topicPublish, $id, $dbLink );
    break;
  }
case "deletePage":
  {
    $message = delete_page_test ( $page_num, $id, $dbLink );
    break;
  }
<?php

echo update_page("VÍDEOS", $this->controller, $form, $this->module);
<?php

echo update_page("COISAS DE FRANCISCO", $this->controller, $form, $this->module);
<?php

echo update_page("LITURGIA", $this->controller, $form, $this->module);
Beispiel #11
0
            echo $page;
            ?>
"><?php 
            echo get_page_stuff($page, "title");
            ?>
</a></td>
			</tr><?php 
        }
    }
    ?>
</table><?php 
}
if ($_POST["action"] == "addnew") {
    if (post_exists($_POST["id"], "page")) {
        $data = "title='" . $_POST["title"] . "', content='" . $_POST["content"] . "'";
        update_page($_POST["id"], $data);
        echo "updated post!";
        echo "<a href=?action=new&id=" . $_POST["id"] . ">Edit again</a> | ";
        echo "<a href=" . get_blog_stuff("url") . get_post_stuff($_POST["id"], "title") . ">Visit</a>";
    } else {
        create_page($_POST["title"], $_POST["content"]);
        echo "created page!";
        echo "<a href=" . get_blog_stuff("url") . "?p=" . $_POST["id"] . ">Visit</a>";
    }
} elseif ($_GET["action"] == "new") {
    ?>
<form method="post" action="<?php 
    echo $_SERVER["PHP_SELF"];
    ?>
">
<input type="hidden" name="action" value="addnew">
Beispiel #12
0
                <a href="medewerkers.php">MEDEWERKERS</a>
            </p>
            <div id="Content" class="clearfix">
                <p id="text6">
                    <span id="textspan1">
                        <form action="" method="POST">
                            <?php 
get_page($page_id);
?>
                            <input type="submit" value="" name="btnSave" class='btnOpslaan'>
                        </form>
                        <?php 
if (isset($_POST['btnSave'])) {
    $title = $_POST['txtTitle'];
    $content = $_POST['txtContent'];
    update_page($page_id, $title, $content);
}
?>
                    </span><br />
                </p>
            </div>
        </div>
        <div id="Footer" class="clearfix">
            <p id="text7">
            COPYRIGHT <?php 
echo date("Y");
?>
&nbsp;&copy; LODESTAR
            </p>
        </div>
    </div>
<?php

echo update_page("PROGRAMAS", $this->controller, $form, $this->module);
<?php

echo update_page("CIDADES", $this->controller, $form, $this->module);
Beispiel #15
0
function my_push()
{
    $rawData = gzinflate(substr(file_get_contents('php://input'), 10, -8));
    $postedJson = json_decode($rawData, true);
    if (json_last_error() != JSON_ERROR_NONE) {
        error_log('Last JSON error: ' . json_last_error() . json_last_error_msg() . PHP_EOL . PHP_EOL, 0);
    }
    try {
        $dbPDO = dbConnect(0, array("SET SESSION wait_timeout = 300;"));
    } catch (PDOException $e) {
        die("DB error, try again.");
    }
    foreach ($postedJson['d'] as $post) {
        if (!isset($post['data'], $post['exec_time'], $post['id'], $post['status'], $post['type'])) {
            die("Wrong parameters");
        }
        if (!is_numeric($post['exec_time'])) {
            die("Wrong parameters");
        }
        //    print "working with ". $post['id'] .PHP_EOL; flush();
        if ($post['type'] == "page") {
            //Is it a stage one crawl.
            update_page($post['id'], $post['exec_time'], $post['data']);
            continue;
        }
        if ($post['status'] != "done") {
            //For some reason the agent did not complete, switch trough error messages and try to react.
            if (isset($post['error_msg'])) {
                if (strpos($post['error_msg'], "(#21)") !== false) {
                    //We got a error 21 "Page ID <old> was migrated to page ID <new>"
                    continue;
                }
                if (strpos($post['error_msg'], "Unsupported get request") !== false) {
                    //We got a error 21 "Page ID <old> was migrated to page ID <new>"
                    $sql = "UPDATE post SET status = 'removed'" . ", who = INET_ATON(" . $dbPDO->quote($_SERVER["REMOTE_ADDR"]) . ") " . ", time = " . $post['exec_time'] . ", time_stamp = UNIX_TIMESTAMP()" . " WHERE page_fb_id = " . $dbPDO->quote(strstr($post['id'], '_', true)) . " AND " . " post_fb_id= " . $dbPDO->quote(substr(strstr($post['id'], '_'), 1)) . "; ";
                    $result = $dbPDO->exec($sql);
                    //if($query != 1)
                    //die("DB error, try again.");
                    continue;
                }
            }
            $sql = "INSERT IGNORE INTO pull_posts VALUES (" . $dbPDO->quote(strstr($post['id'], '_', true)) . "," . ($post['type'] == "page" ? "0" : $dbPDO->quote(substr(strstr($post['id'], '_'), 1))) . ");";
            $result = $dbPDO->exec($sql);
            continue;
        }
        //Make sure that we already have the posts file in the DB.
        $sql = "SELECT page_fb_id, post_fb_id, CONCAT(page_fb_id , '_' , DATE_FORMAT(date,'%Y-%m-%dT%H'),'_',page_fb_id,'_',post_fb_id,'.json')" . " AS fname, REPLACE(name,' ','_') AS archive, fb_id FROM post,page WHERE page_fb_id=fb_id AND page_fb_id=" . $dbPDO->quote(strstr($post['id'], '_', true)) . " AND post_fb_id=" . $dbPDO->quote(substr(strstr($post['id'], '_'), 1));
        $result = $dbPDO->query($sql);
        if ($row = $result->fetchAll()[0]) {
            $archive = realpath(dirname(__FILE__)) . '/phar/' . preg_replace('/[^[:alnum:]]/', '_', $row['archive']) . '-' . $row['fb_id'];
            //Lock archive, this lock will be released when we get a new lock or close connection.
            $lock = $dbPDO->query("SELECT GET_LOCK(" . $dbPDO->quote($archive) . ", 30);")->fetchAll()[0][0];
            if ($lock != 1) {
                //Unable to get lock.
                die("Unable to get lock for: " . $archive);
            }
            if (!phar_put_contents($row['fname'], $archive, $post['data'])) {
                die("Unable to write the file: " . $row['fname']);
            }
            //continue; //We did not manage to write to our phar archive, try with next post.
            $sql = "UPDATE post SET status = 'done'" . ", who = INET_ATON(" . $dbPDO->quote($_SERVER["REMOTE_ADDR"]) . ") " . ", time = " . $post['exec_time'] . ", time_stamp = UNIX_TIMESTAMP()" . " WHERE page_fb_id = " . $row['page_fb_id'] . " AND " . " post_fb_id= " . $row['post_fb_id'] . "; ";
            $query = $dbPDO->exec($sql);
            if ($query != 1) {
                die("DB error, try again.");
            }
            /*
             * Insert into db
             */
            $db = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, MYSQL_PORT);
            if ($db->connect_error) {
                error_log('Connect Error F (' . $db->connect_errno . ') ' . $db->connect_error, 0);
                continue;
            }
            $GLOBALS['db'] =& $db;
            try {
                insertToDB(parseJsonString($post['data']), $db);
                $db->close();
            } catch (Exception $e) {
                error_log("Parse Error (" . $post['id'] . ") " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine(), 0);
            }
        } else {
            die("No post with id {$post_id} in db");
        }
    }
    print "Pushed to db.\n";
    return;
}
<?php

echo update_page("ESTADOS", $this->controller, $form, $this->module);