コード例 #1
0
function buildLink($wvActionId, $options, $caption)
{
    $lttemp = false;
    if (isset($_POST["login"])) {
        if ($_POST["login"] == "1") {
            $lttemp = true;
        }
    }
    if ($lttemp == true) {
        //Check that the user is properly logged in
        $wvuserpasswdmd5ln = qry('user', 'user_password_md5', 'user_name', fv('wvUserName'));
        if (md5($_SESSION['wvUserPassword']) == $wvuserpasswdmd5ln) {
            $loginverifiedln = 1;
            $loginln = 1;
        } else {
            $loginverifiedln = 0;
            err(5);
            $loginbl = 0;
        }
        if ($loginverifiedln == 1) {
        } else {
            err(289);
            $loginln = 0;
        }
    } else {
        $loginln = 0;
    }
    $localeid = fv('locale');
    if ($loginln == 0) {
        if ($options == '') {
            $separator = '';
            $options = $options . '&locale=' . $localeid;
            $options = str_replace('&&', '&', $options);
        } else {
            $separator = '&';
            $options = $options . 'locale=' . $localeid;
            $options = str_replace('&&', '&', $options);
        }
        $linkGenerated = itr(38) . $wvActionId . $separator . $options . itr(39) . $caption . itr(40);
    } else {
        if ($options == '') {
            $separator = '';
            $options = $options . '&wvSession=' . session_id() . '&' . itr(63) . $localeid;
            $options = str_replace('&&', '&', $options . '&wvSession=' . session_id());
        } else {
            $separator = itr(41);
            $options = $options . '&' . itr(62) . $localeid;
            $options = str_replace('&&', '&', $options);
        }
        $linkGenerated = str_replace('&&', '&', itr(42) . $wvActionId . str_replace(itr(54), itr(43), str_replace('=', itr(44), $options)) . itr(1083) . $caption . itr(1084));
    }
    return $linkGenerated;
}
コード例 #2
0
function shorten($content)
{
    if (strlen($content) > 32) {
        //trim to 64 but round by words
        $shortenedstring = str_trunc($content, 32) . itr(1493);
        global $baggage_claim;
        $baggage_claim->check_luggage('Shortened', 'true');
        if (strlen($shortenedstring) > 40) {
            //trim to 64
            $shortenedstring = substr($content, 0, 32) . itr(1493);
        }
    } else {
        $shortenedstring = $content;
        global $baggage_claim;
        $baggage_claim->check_luggage('Shortened', 'false');
    }
    return $shortenedstring;
}
コード例 #3
0
function unrecognisedAction()
{
    echo itr(46) . $_POST['action'] . itr(47);
}
コード例 #4
0
            } else {
                $disambigStr = itr(769) . itr(qry('node_revision', 'node_revision_disambiguation_description', 'node_revision_id', $thisNodeRevId)) . itr(770);
            }
            $title = c(shorten(itr(qry('node_revision', 'node_revision_title', 'node_revision_id', $thisNodeRevId))) . $disambigStr);
            $shortdesc = c(itr(qry('node_revision', 'node_revision_short_description', 'node_revision_id', $thisNodeRevId)));
            $teststringthing = str_replace('<br>', '', str_replace(': ', '', str_replace('</p>', '', str_replace('<p>', '', str_replace('</strong>', '', $shortdesc)))));
            if (strlen($teststringthing) === 0) {
                $separator = itr(858);
            } else {
                $separator = itr(859);
            }
            if (!isset($thisNodeEntry)) {
                $thisNodeEntry = null;
            }
            $thisNodeEntry = $thisNodeEntry . buildLink('6', '&nodeId=' . $this_node_id . '&', $this_node_id . itr(856) . itr(857) . $title . $separator . $shortdesc) . itr(74);
            $this_node_id = $this_node_id + 1;
        }
        $pageTitle = itr(850) . $start . itr(851) . $end;
        $nodeList = $thisNodeEntry;
        $idxNav = buildLink('19', '&st=' . $prevStart . '&', itr(852)) . itr(854) . buildLink('19', '&st=' . $nextStart . '&', itr(853));
        $pageBody = $nodeList . itr(855) . $idxNav;
    } else {
        if (empty($pageBody) && empty($pageTitle)) {
            $nothing = 'Oh, *damn*... I dunno what /that/ is...';
            $pageBody = itr(22);
            $pageTitle = itr(23);
        } else {
        }
    }
}
/* END ACTION DEFINITIONS */
コード例 #5
0
function beginForm($caption, $action_id)
{
    return $caption . itr(1242) . $action_id . itr(1261);
}
コード例 #6
0
function newNodeRevisionExecute()
{
    if (fv('nodeDataUploadFlag')) {
        //					 echo 'Adding data…';
        $tablenamenewdata = "data";
        $next_incrementdata = 0;
        $qShowStatusdata = "SHOW TABLE STATUS LIKE '{$tablenamenewdata}'";
        $qShowStatusResultdata = mysql_query($qShowStatusdata) or die("Query failed: " . mysql_error() . "<br/>" . $qShowStatusdata);
        $rowdata = mysql_fetch_assoc($qShowStatusResultdata);
        $next_incrementdata = $rowdata['Auto_increment'];
        mysql_query('INSERT INTO `data` (`data_id`, `data_current_revision`) VALUES (NULL, \'' . $next_incrementdata . '\');');
        $addedDataId = mysql_insert_id();
        //					 echo 'data number ' . $addedDataId . 'and data revision number ';
        $fileTempName = $_FILES['uploadeddata']['tmp_name'];
        mysql_query('INSERT INTO `data_revision` (`data_revision_id`, `data_revision_name`, `data_revision_length`, `data_revision_type`, `data_revision_node_id`, `data_revision_md5`, `data_revision_data_id`, `data_revision_node_edit_id`) VALUES (NULL, \'' . $HTTP_POST_FILES['uploadeddata']['name'] . '\', \'' . $HTTP_POST_FILES['uploadeddata']['size'] . '\', \'' . fv('dataType') . '\', \'nodeid\', \'' . md5_file($fileTempName) . '\', \'' . $addedDataId . '\', \'not yet known\');');
        $targetULDirectory = 'weave/data/' . str_replace(0, '0/', str_replace(1, '1/', str_replace(2, '2/', str_replace(3, '3/', str_replace(4, '4/', str_replace(5, '5/', str_replace(6, '6/', str_replace(7, '7/', str_replace(8, '8/', str_replace(9, '9/', mysql_insert_id()))))))))));
        mkdir($targetULDirectory, 0700, true);
        /*					  $ck = mysql_insert_id();
                        $subdirs = array();
                        
                        for ($i = 0;$i < strlen($ck);$i++) $subdirs[] = $ck[$i];
                */
        $addedDataRevisionId = mysql_insert_id();
        //					echo $addedDataRevisionId;
        $targetULDirectory = $targetULDirectory . $addedDataRevisionId . '.wdf';
        //					 echo $targetULDirectory;
        move_uploaded_file($fileTempName, $targetULDirectory);
    } else {
        //					 echo 'not adding data. ';
    }
    $tablenamenewnode = "node_revision";
    $next_incrementnode = 0;
    $qShowStatusnode = "SHOW TABLE STATUS LIKE '{$tablenamenewnode}'";
    $qShowStatusResultnode = mysql_query($qShowStatusnode) or die("Query failed: " . mysql_error() . "<br/>" . $qShowStatusnode);
    $rownode = mysql_fetch_assoc($qShowStatusResultnode);
    $next_incrementnode_revision = $rownode['Auto_increment'];
    mysql_query('UPDATE `node` SET `node_current_revision` = \'' . $next_incrementnode_revision . '\' WHERE `node_id` =' . fv('nodeId') . ' LIMIT 1 ;');
    //INSERT INTO  `node` (	`node_id` , `node_current_revision` ) VALUES (' . fv('nodeId') . ',  \'' . $next_incrementnode_revision . '\');');
    $nodeEditedId = mysql_insert_id();
    newintf($_POST['nodeDisplayTitle']);
    global $newIntfId;
    $nodeDisplayTitleIntfId = $newIntfId;
    newintf($_POST['nodeShortTitle']);
    global $newIntfId;
    $nodeShortTitleIntfId = $newIntfId;
    newintf($_POST['nodeTitle']);
    global $newIntfId;
    $nodeTitleIntfId = $newIntfId;
    newintf($_POST['nodeSource']);
    global $newIntfId;
    $nodeSourceIntfId = $newIntfId;
    newintf($_POST['nodeSortTitle']);
    global $newIntfId;
    $nodeSortTitleIntfId = $newIntfId;
    newintf($_POST['nodeDescription']);
    global $newIntfId;
    $nodeDescriptionIntfId = $newIntfId;
    newintf($_POST['nodeDisambiguationDescription']);
    global $newIntfId;
    $nodeDisambiguationDescriptionIntfId = $newIntfId;
    newintf($_POST['nodeComment']);
    global $newIntfId;
    $nodeCommentIntfId = $newIntfId;
    newintf($_POST['nodeShortDescription']);
    global $newIntfId;
    $nodeShortDescriptionIntfId = $newIntfId;
    $newNodeOwnerId = qry('user', 'user_id', 'user_name', mysql_real_escape_string($_POST['userName']));
    $newNodeData = array("node_revision_type" => $_POST['nodeType'], "node_revision_display_title" => $nodeDisplayTitleIntfId, "node_revision_short_title" => $nodeShortTitleIntfId, "node_revision_title" => $nodeTitleIntfId, "node_revision_permissions" => $_POST['nodePermissions'], "node_revision_relationships" => $_POST['nodeRelationships'], "node_revision_source" => $nodeSourceIntfId, "node_revision_sort_title" => $nodeSortTitleIntfId, "node_revision_description" => $nodeDescriptionIntfId, "node_revision_disambiguation_description" => $nodeDisambiguationDescriptionIntfId, "node_revision_metadata" => $_POST['nodeMetadata'], "node_revision_comment" => $nodeCommentIntfId, "node_revision_short_description" => $nodeShortDescriptionIntfId, "node_revision_universe_status" => $_POST['nodeUniverseStatus'], "node_revision_owner" => $newNodeOwnerId, "node_revision_copyright_flag" => $_POST['nodeCopyrightFlag'], "node_revision_morality_flag" => $_POST['nodeMoralityFlag'], "node_revision_personal_flag" => $_POST['nodePersonalFlag'], "node_revision_data_id" => $addedDataId, "node_revision_node_id" => fv('nodeId'), "node_revision_minor_flag" => $_POST['nodeMinorFlag'], "node_revision_time" => getnow());
    ins('node_revision', $newNodeData);
    $nodeRevisionAddedId = mysql_insert_id();
    $nodeEditedId = fv('nodeId');
    $user = new user(0, '', 0, fv('wvUserName'), 0, '', '', '');
    $user->request_content('user_name', fv('wvUserName'));
    $newnodeeditids = $user->node_edit_ids . itr(1494) . $nodeRevisionAddedId;
    $user->set_variable('node_edit_ids', $newnodeeditids);
    return $nodeEditedId;
}
コード例 #7
0
 function addLink($action, $options, $caption)
 {
     $lttemp = false;
     if (isset($_REQUEST["login"])) {
         if ($_REQUEST["login"] == "1") {
             $lttemp = true;
         }
     }
     if ($lttemp == true) {
         //Check that the user is properly logged in
         if ($this->checkLogin()) {
             $loginverifiedln = 1;
             $loginln = 1;
         } else {
             $loginverifiedln = 0;
             $this->fail("Login not verified: Password does not match stored check — Probably the password provided was incorrect.");
             $loginbl = 0;
         }
         if ($loginverifiedln == 1) {
         } else {
             $this->fail("Login error: could not authenticate.");
             $loginln = 0;
         }
     } else {
         $loginln = 0;
     }
     $localeid = fv('locale');
     if ($loginln == 0) {
         if ($options == '') {
             $separator = '';
             $options = $options . '&locale=' . $localeid;
             $options = str_replace('&&', '&', $options);
         } else {
             $separator = '&';
             $options = $options . 'locale=' . $localeid;
             $options = str_replace('&&', '&', $options);
         }
         $linkGenerated = '<a href="ember.php?wintNeeded=emberWebView&wint=1&emAction=' . $action . $separator . $options . '">' . $caption . '</a>';
     } else {
         if ($options == '') {
             $separator = '';
             $options = $options . '&emSession=' . session_id() . '&locale=' . $localeid;
             $options = str_replace('&&', '&', $options . '&emSession=' . session_id());
         } else {
             $separator = itr(41);
             $options = $options . '&locale=' . $localeid;
             $options = str_replace('&&', '&', $options);
         }
         $linkGenerated = str_replace('&&', '&', '<form action="ember.php" method="post"><input type="hidden" name="wint" value="1"><input type="hidden" name="wintNeeded" value="emberWebView"><input type="hidden" name="emAction" value="' . $action . str_replace('&', '"><input type="hidden" name="', str_replace('=', '" value="', $options)) . '"><input type="hidden" name="login" value="1"><button type="submit" class="t">' . $caption . '</button></form>');
     }
     return $linkGenerated;
 }
コード例 #8
0
/* PREFETCH PAGE PARAMETERS */
if (isset($_POST["login"])) {
    if ($_POST["login"] == "1") {
        global $login;
        //Check that the user is properly logged in
        $userPasswdMd5 = qry('user', 'user_password_md5', 'user_name', fv('wvUserName'));
        if (md5(fv('wvUserPassword')) == $userPasswdMd5) {
            $loginverified = 1;
            $login = 1;
        } else {
            $loginverified = 0;
            err(5);
            $login = 0;
        }
        if ($loginverified !== 1) {
            err(6);
            $login = 0;
        }
    } else {
        //	itf(7);
        $login = 0;
    }
} else {
    $login = 0;
}
//page title
//Prepare data
fv('nodeId');
$titleAttr = itr(21);
/* END PAGE PARAMETERS */
コード例 #9
0
 function new_intf()
 {
     global $pageBody;
     global $pageTitle;
     if (!isset($wvLocaleString)) {
         $wvLocaleString = null;
     }
     if (!isset($HttpsWPUrl)) {
         $HttpsWPUrl = null;
     }
     $newInterface_exchange = new intf(0, $wvLocaleString, $HttpsWPUrl, '');
     global $baggage_claim;
     $text_object = $baggage_claim->claim_luggage('InterfaceTextObject');
     $pageBody = beginForm(itr(1264), itr(1263)) . $text_object->request_content() . finishForm(itr(67));
     $pageTitle = itr(81);
 }
コード例 #10
0
function finishForm($caption)
{
    return itr(286) . session_id() . itr(45) . $caption . itr(60);
}
コード例 #11
0
$breadSeparator = itr(1135);
if (!isset($nodeRevId)) {
    $nodeRevId = null;
}
if (!isset($disambigStr)) {
    $disambigStr = null;
}
$nodeBCTitle = $nodeId . itr(1150) . c(shorten(itr(qry('node_revision', 'node_revision_title', 'node_revision_id', $nodeRevId))) . $disambigStr);
if (!strlen(fv('nodeId')) > 0) {
    $nodeNameTag = "";
} else {
    $nodeNameTag = itr(1136) . buildLink(6, '&nodeId=' . fv('nodeId') . '&', $nodeBCTitle);
}
if ($wvActionId == 'nodeView') {
    $actionlinkid = '19';
} else {
    $actionlinkid = fv('a');
}
e(str_replace('&a=6&locale', '&a=19&locale', itr(1139) . buildLink(1, '', itr(1137)) . itr(1158) . $breadSeparator . itr(1158) . buildLink($actionlinkid, '', $wvActionDispName) . $nodeNameTag));
if (!isset($pageMenu)) {
    $pageMenu = null;
}
echo $pageMenu;
itf(33);
echo $pageTitle;
itf(34);
echo $pageBody;
e(res('4.d2'));
//Execute script
//echo 'passed test';
/* END PAGE */