function request_content($filter, $filtervalue)
 {
     $this->id = qry('user', 'user_id', $filter, $filtervalue);
     $this->registration_ip = qry('user', 'user_registration_ip', $filter, $filtervalue);
     $this->node_id = qry('user', 'user_node_id', $filter, $filtervalue);
     $this->name = qry('user', 'user_name', $filter, $filtervalue);
     $this->authorisation_type = qry('user', 'user_authorisation_type', $filter, $filtervalue);
     $this->password_md5 = qry('user', 'user_password_md5', $filter, $filtervalue);
     $this->ip_list = qry('user', 'user_ip_list', $filter, $filtervalue);
     $this->node_edit_ids = qry('user', 'user_node_edit_ids', $filter, $filtervalue);
 }
Example #2
0
 public function home()
 {
     if ($_POST) {
         $home = $this->input->post('home');
         $this->pages_m->update('2', array('page_detail' => htmlentities($home)));
         qry();
         $this->session->set_flashdata('success', 'Page has been Successfully Updated.');
         // redirect('admin/pages/home');
     }
     $data['page'] = $this->pages_m->get(2);
     $this->template->load('admin', 'admin/pages/home', $data);
 }
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;
}
Example #4
0
function c($content)
{
    $retval = $content;
    $pattern = '@(\\d+)@';
    $matches = array();
    preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);
    foreach ($matches as $match) {
        $match_html = qry('character', 'character_html', 'character_id', $match[1]);
        $retval = str_replace('@' . $match[1] . '@', $match_html, $retval);
    }
    return $retval;
}
<?php

/* VERIFYING ACTION APPROVAL */
$axnAuthPriv = qry('operation', 'operation_permission_required', 'operation_id', fv('a'));
if ($login == 0) {
    $userAuth = 0;
} else {
    $userAuth = qry('user', 'user_authorisation_type', 'user_name', fv('wvUserName'));
}
if ($userAuth >= $axnAuthPriv) {
    $userpermissionverified = 1;
    if (strpos('node', $wvActionId) === true || strpos('Node', $wvActionId) === true) {
        //TODO
        checkPermissions($nodeId);
        if ($userPermissionRead == 1 || $userPermissionWrite == 2 && $wvActionIdCheck == 'viewNode' || $userPermissionWrite == 2 && $wvActionIdCheck == 'editNode') {
            $nodepermerr == 1;
        } else {
            $nodepermerr == 0;
            echo SELECT;
        }
    } else {
        //This is not a node action
        $nodepermerr = 0;
    }
} else {
    $userpermissionverified = 0;
}
/* END ACTION APPROVAL */
Example #6
0
function qrp($table, $field, $filter, $filtervalue)
{
    e(qry($table, $field, $filter, $filtervalue));
}
 if ($nextStart > $nodeMax) {
     $nextStart = $start;
 }
 if ($nextStart == $nodeMax) {
     $nextStart = $nodeMax;
 }
 $this_node_id = $start;
 while ($this_node_id <= $end) {
     $thisNodeRevId = qry('node', 'node_current_revision', 'node_id', $this_node_id);
     if (!itr(qry('node_revision', 'node_revision_disambiguation_description', 'node_revision_id', $thisNodeRevId))) {
         $disambigStr = '';
     } 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));
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;
}
<?php

/* 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);
Example #10
0
 public function edit($id = 0)
 {
     /* if ($this->form_validation->run('project') == FALSE){ */
     if ($id == '' || $id == 0) {
         show_404();
     }
     $data['project_type'] = $this->project_model->get_all_types();
     $data['project_manager'] = $this->project_model->get_project_manager();
     $data['categories'] = $this->project_model->get_caregory();
     $data['project'] = $this->project_model->get($id);
     $data['action_plan'] = $this->project_model->get_action_plan($id);
     $data['timesheet'] = $this->project_model->get_timesheet($id);
     $data['attachment'] = $this->project_model->get_project_attachment($id);
     $data['notes'] = $this->project_model->get_project_notes($id);
     $data['external_link'] = $this->project_model->get_project_external_link($id);
     $data['suppliers'] = $this->products_model->getfrom('project_suppliers', 'project_suppliers.id as pid,project_suppliers.*,suppliers.*', array('where' => array('project_suppliers.project_id' => $id)), array('join' => array(array('table' => 'suppliers', 'condition' => 'suppliers.id = project_suppliers.supplier_id'))));
     if (empty($data['project'])) {
         show_404();
     }
     $this->template->load('admin_default', 'project/edit', $data);
     /* }else{ */
     if (!empty($_POST)) {
         if ($this->project_model->update_records($id, TRUE)) {
             $this->session->set_flashdata('msg', 'Your project has been successfully updated');
         } else {
             $this->session->set_flashdata('err_msg', 'Oops!Something Wrong!');
         }
         qry(true);
         redirect('project');
     }
     /* } */
 }
<?php

//DEFINE FUNCTIONS
//Utility functions
include 'd/r/wfs.utility.php';
//Database abstraction layer
include 'd/r/wfs.dba.php';
//Get a parameter regardless of method
include 'd/r/wf.fv.php';
//CDCE parser
include 'd/r/wfs.dce.php';
//Define variables
$wvActionId = qry('operation', 'operation_name', 'operation_id', fv('a'));
$wvLocaleString = qry('locale', 'locale_suffix', 'locale_id', fv('locale'));
//Page renderer functions
include 'd/r/wfs.render.php';
//Error handling
include 'd/r/wfs.errorhandling.php';
//Weave         abstraction layer
//   structures
include 'd/r/wfs.Weave_structures.php';
/* END FUNCTION DEFS */
function gHeader($user)
{
    $sql = "SELECT * FROM usuarios WHERE idUsuario = '{$user}'";
    $res = qry($sql);
    $cam = mysql_fetch_assoc($res);
    echo "{$cam['numero']} - {$cam['nombre']} {$cam['apellidoPaterno']}";
}
    echo buildLink('3', 'nodeId=' . fv('nodeId') . '&', itr(30));
    itf(66);
    echo buildLink('4', '', itr(31));
    itf(66);
    echo buildLink('11', '', itr(84));
}
//Breadcrumb navigation
$wvActionDispName = itr(qry('operation', 'operation_disp_name', 'operation_id', fv('a')));
$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;