function testComments_preview()
 {
     global $t, $bx, $auth, $subject, $text;
     $auth->set_uname('this is the username');
     $subject = 'this is the subject';
     $text = 'this is the text//\\//\\fubar[[]][*](?)';
     $db_config = new mock_db_configure(1);
     $db_config->add_query("SELECT email_usr FROM auth_user WHERE " . "username='******'");
     $bx = $this->_create_default_box();
     $this->capture_call('comments_preview', 983 + strlen(timestr(time())), array(''));
     $this->_checkFor_a_box('Comment', '%s ' . stripslashes($subject));
     $this->_checkFor_a_box('PREVIEW', '<center><b>%s</b></center>');
     $ps = array(0 => $this->_to_regexp(lib_nick($auth->auth['uname'])), 1 => $this->_to_regexp("<p>" . stripslashes($text) . "\n"));
     $this->_testFor_patterns($ps, 2);
     $this->_check_db($db_config);
 }
 function testShow_consultants()
 {
     global $db, $t, $bx;
     $db_config = new mock_db_configure(2);
     $db_q = array(0 => "SELECT * FROM consultants,auth_user WHERE " . "proid='%s' AND username=consultant ORDER " . "BY creation");
     $dat = $this->_generate_records(array("proid"), 2);
     $rows = $this->_generate_records(array("username", "status", "creation"), 3);
     $db_config->add_query(sprintf($db_q[0], $dat[0]["proid"]), 0);
     $db_config->add_query(sprintf($db_q[0], $dat[1]["proid"]), 1);
     $db_config->add_num_row(0, 0);
     $db_config->add_num_row(3, 1);
     $db_config->add_record($rows[0], 1);
     $db_config->add_record($rows[1], 1);
     $db_config->add_record($rows[2], 1);
     // first test: no data to list, print error message
     $db = new DB_SourceAgency();
     $bx = new box();
     $this->set_msg("test 1");
     $this->capture_call('show_consultants', 64, &$dat[0]);
     $this->_testFor_pattern("No developers have offered " . "themselves as consultants yet");
     // second test: three pieces of data
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->set_msg('test 2');
     $this->capture_call('show_consultants', 3573, &$dat[1]);
     $this->_checkFor_a_box('Consultants');
     $this->_checkFor_columns(4);
     $this->_checkFor_column_titles(array("Number", "Username", "Status", "Creation"), '', '', '');
     $colors = array(1 => 'gold', 0 => '#FFFFFF');
     for ($idx = 1; $idx < 4; $idx++) {
         $row = $rows[$idx - 1];
         $this->set_msg("Test {$idx}");
         $this->_testFor_box_next_row_of_columns();
         $this->_checkFor_column_values(array('<b>' . $idx . '</b>', '<b>' . lib_nick($row['username']), '<b>' . show_status($row["status"]) . '</b>', '<b>' . timestr(mktimestamp($row["creation"])) . '</b>'), '', '', $colors[$idx % 2]);
     }
     $this->_check_db($db_config);
 }
 function testCooperation_show()
 {
     global $t, $bx, $db, $sess;
     $qs = array(0 => "SELECT * FROM cooperation,auth_user WHERE devid='%s'" . " AND developer=username ORDER BY creation DESC", 1 => "SELECT * FROM comments,auth_user WHERE proid='%s' " . "AND type='%s' AND number='%s' AND ref='%s' AND " . "user_cmt=username ORDER BY creation_cmt ASC");
     $db_config = new mock_db_configure(3);
     $args = $this->_generate_records(array('proid', 'devid'), 10);
     $dat = $this->_generate_records(array('creation', 'cost', 'status', 'developer'), 20);
     // test one
     $db_config->add_query(sprintf($qs[0], $args[0]['devid']), 0);
     $db_config->add_num_row(0, 0);
     // test two
     $db_config->add_query(sprintf($qs[0], $args[1]['devid']), 1);
     $db_config->add_num_row(1, 1);
     $db_config->add_record($dat[0], 1);
     $db_config->add_record(false, 1);
     $db_config->add_query(sprintf($qs[1], $args[1]['proid'], 'Cooperation', $dat[0]['creation'], '0'), 2);
     $db_config->add_num_row(0, 2);
     // test one: no records
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('cooperation_show', 77, $args[0]);
     $this->assertEquals("<p>There have not been posted any cooperation " . "proposals by any developer.<p>\n", $this->get_text());
     // test two: one row of data
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('cooperation_show', 916, $args[1]);
     $this->_checkFor_a_box('Cooperation');
     $this->_testFor_lib_nick($dat[0]['developer']);
     $str = ' - ' . timestr(mktimestamp($dat[0]['creation'])) . "</b>";
     $this->_testFor_pattern($this->_to_regexp($str));
     $str = '<p><b>Cost</b>: ' . $dat[0]['cost'] . " euro\n";
     $this->_testFor_pattern($this->_to_regexp($str));
     $str = '<br><b>Status</b>: ' . show_status($dat[0]['status']) . "\n";
     $this->_testFor_pattern($this->_to_regexp($str));
     $this->_testFor_lib_comment_it($args[1]['proid'], 'Cooperation', $dat[0]['creation'], 0, '', $t->translate('Comment This Cooperation!'));
     $this->_check_db($db_config);
 }
     echo "<tr><td align=right width=30%>" . $t->translate("Contact") . ":</td><td width=70%>";
     $pquery["devname"] = $db->f("username");
     htmlp_link("pmess_compose.php", $pquery, $t->translate("write Developer"));
 }
 if ($db->f("showemail") == "yes") {
     echo "<tr><td align=right width=30%>" . $t->translate("E-Mail") . ":</td><td width=70%><a href=\"mailto:" . $db->f("email_usr") . "\">" . ereg_replace("@", " at ", htmlentities($db->f("email_usr"))) . "</a>\n";
 }
 echo "<tr><td align=right width=30%>" . $t->translate("Developer last modified") . ":</td><td width=70%>\n";
 $timestamp = mktimestamp($db->f("modification_usr"));
 echo timestr($timestamp) . "</td></tr>\n";
 echo "<tr><td align=right width=30%>" . $t->translate("Developer created") . ":</td><td width=70%>\n";
 $timestamp = mktimestamp($db->f("creation_usr"));
 echo timestr($timestamp) . "</td></tr>\n";
 echo "<tr><td align=right width=30%>" . $t->translate("Profile last modified") . ":</td><td width=70%>\n";
 $timestamp = mktimestamp($db->f("creation"));
 echo timestr($timestamp) . "</td></tr>\n";
 $db2->query("SELECT devel_cnt FROM counter WHERE develid='{$develid}'");
 $db2->next_record();
 echo "<tr><td align=right width=30%>" . $t->translate("# of Visits") . ":</td><td width=70%>\n";
 echo $db2->f("devel_cnt") . "</td></tr>\n";
 echo "<tr><td align=right width=30%>" . $t->translate("Registration Number") . ":</td><td width=70%>\n";
 echo printf("#%09d", $develid) . "</td></tr>\n";
 echo "</table>\n";
 $bx->box_body_end();
 $bx->box_end();
 $bx->box_begin();
 $bx->box_title($t->translate("Professional Data"));
 $bx->box_body_begin();
 echo "<table border=0 width=100% align=center cellspacing=3 cellpadding=3>\n";
 $profid = $db->f("profession");
 $prof = get_profession($profid);
 function testSponsoring_preview()
 {
     global $auth, $sponsoring_text, $budget, $valid_day, $valid_month, $valid_year, $begin_day, $begin_month, $begin_year, $finish_day, $finish_month, $finish_year, $bx, $t;
     $auth->set_uname("this is the username");
     $sponsoring_text = "this is the sponsoring text";
     $budget = "this is the budget";
     $valid_day = 3;
     $begin_day = 4;
     $finish_day = 5;
     $valid_month = 4;
     $begin_month = 5;
     $finish_month = 6;
     $valid_year = 2001;
     $begin_year = 2002;
     $finish_year = 2003;
     $bx = $this->_create_default_box();
     $this->capture_call('sponsoring_preview', 1196 + strlen(timestr(time())));
     $this->set_msg('test 1');
     $this->_checkFor_a_box('PREVIEW', '<center><b>%s</b></center>');
     $this->_checkFor_a_box('Sponsor Involvement');
     $this->_testFor_lib_nick($auth->auth['uname']);
     $v = array('Status' => 'Proposed', 'Validity' => timestr_middle(mktimestamp(date_to_timestamp($valid_day, $valid_month, $valid_year))), 'Finish before' => timestr_middle(mktimestamp(date_to_timestamp($finish_day, $finish_month, $finish_year))), 'Begin wished' => timestr_middle(mktimestamp(date_to_timestamp($begin_day, $begin_month, $begin_year))), 'Max. sum of money' => "{$budget} euros", 'Comments to the involvement' => "{$sponsoring_text}");
     while (list($key, $val) = each($v)) {
         $this->_testFor_pattern($this->_to_regexp('<b>' . $t->translate($key) . ':</b> ' . $val));
     }
 }
 function testShow_referees()
 {
     global $t, $bx, $db;
     $db_config = new mock_db_configure(2);
     $pid1 = "this sit he proid";
     $pid2 = "this sit he proid two";
     $q = $this->queries['show_referees'];
     $db_config->add_query(sprintf($q, $pid1), 0);
     $db_config->add_num_row(0, 0);
     $db_config->add_num_row(0, 0);
     $db_config->add_query(sprintf($q, $pid2), 1);
     $dat = $this->_generate_records(array('username', 'status', 'creation'), 5);
     $db_config->add_num_row(count($dat), 1);
     $db_config->add_num_row(count($dat), 1);
     for ($idx = 0; $idx < count($dat); $idx++) {
         $db_config->add_record($dat[$idx], 1);
     }
     // test one, no record/data
     $bx = $this->_create_default_box();
     $db = new DB_SourceAgency();
     capture_reset_and_start();
     show_referees($pid1);
     $this->set_text(capture_stop_and_get());
     $this->push_msg("Test One");
     $this->_testFor_string_length(72);
     $msg = $t->translate("There are no developers that have " . "offered themselves as referees");
     $this->_testFor_pattern($this->_to_regexp($msg));
     $this->pop_msg();
     // test two, data is defined
     $bx = $this->_create_default_box();
     $db = new DB_SourceAgency();
     capture_reset_and_start();
     show_referees($pid2);
     $this->set_text(capture_stop_and_get());
     $this->push_msg("Test Two");
     $this->_testFor_string_length(4940);
     $msg = $t->translate("There are no developers that have " . "offered themselves as referees");
     $this->reverse_next_test();
     $this->_testFor_pattern($this->_to_regexp($msg));
     $this->_checkFor_a_box('Referees');
     $this->_checkFor_columns(4);
     $this->_checkFor_column_titles(array('Number', 'Username', 'Status', 'Creation'), '', '', '');
     $colors = array(0 => '#FFFFFF', 1 => 'gold');
     for ($idx = 0; $idx < count($dat); $idx++) {
         $v = array("<b>" . ($idx + 1) . "</b>", '<b>' . lib_nick($dat[$idx]['username']) . '</b>', '<b>' . show_status($dat[$idx]['status']) . '</b>', '<b>' . timestr(mktimestamp($dat[$idx]['creation'])) . '</b>');
         $this->push_msg("Test {$idx}");
         $this->_checkFor_column_values($v, '', '', $colors[$idx % 2]);
         $this->pop_msg();
     }
     $this->pop_msg();
     $this->_check_db($db_config);
 }
"><input type="text" name="realname" size=12 maxlength=64 value="<?php 
        $db->p("realname");
        ?>
"></td>
<td bgcolor="<?php 
        echo $th_box_body_bgcolor;
        ?>
"><input type="text" name="email_usr" size=12 maxlength=32 value="<?php 
        $db->p("email_usr");
        ?>
"></td>
<?php 
        $time = mktimestamp($db->f("modification_usr"));
        echo "  <td bgcolor=\"{$th_box_body_bgcolor}\">" . timestr($time) . "</td>\n";
        $time = mktimestamp($db->f("creation_usr"));
        echo "  <td bgcolor=\"{$th_box_body_bgcolor}\">" . timestr($time) . "</td>\n";
        ?>
<td bgcolor="<?php 
        echo $th_box_body_bgcolor;
        ?>
"><?php 
        print $perm->perm_sel("perms", $db->f("perms"));
        ?>
</td>
<td bgcolor="<?php 
        echo $th_box_body_bgcolor;
        ?>
" align=right>
<input type="hidden" name="u_id" value="<?php 
        echo $db->p("user_id");
        ?>
示例#8
0
    if (!isset($period)) {
        $period = "daily";
    }
    if ($msg = nlmsg($period)) {
        $subj = "{$sys_name} {$period} newsletter for " . date("l dS of F Y");
        if (isset($send)) {
            // Send newsletter
            switch ($period) {
                case "weekly":
                    mail($ml_weeklynewstoaddr, $subj, $msg, "From: {$ml_newsfromaddr}\nReply-To: {$ml_newsreplyaddr}\nX-Mailer: PHP");
                    $bx->box_full($t->translate("Weekly Newsletter"), $t->translate("Newsletter was sent at ") . timestr(time()));
                    break;
                case "daily":
                default:
                    mail($ml_newstoaddr, $subj, $msg, "From: {$ml_newsfromaddr}\nReply-To: {$ml_newsreplyaddr}\nX-Mailer: PHP");
                    $bx->box_full($t->translate("Daily Newsletter"), $t->translate("Newsletter was sent at ") . timestr(time()));
                    break;
            }
        }
        $bx->box_full($subj, "<pre>\n" . htmlentities($msg) . "\n</pre>\n");
        ?>
<form method="get" action="<?php 
        $sess->pself_url();
        ?>
">
<?php 
        echo "<input type=\"hidden\" name=\"period\" value=\"{$period}\">\n";
        echo "<center><p><input type=\"submit\" name=\"send\" value=\"" . $t->translate("Send newsletter") . "\"></center>\n";
        echo "</form>\n";
    } else {
        $be->box_full($t->translate("Error"), $t->translate("No Document found") . ".");
示例#9
0
# BerliOS DocsWell: http://docswell.berlios.de
# BerliOS - The OpenSource Mediator: http://www.berlios.de
#
# Login registrated users
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "DocsWell_Session", "auth" => "DocsWell_Auth", "perm" => "DocsWell_Perm"));
require "./include/header.inc";
$bx = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
$be = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_error_font_color, $th_box_body_align);
?>

<!-- content -->
<?php 
if ($perm->have_perm("user_pending")) {
    $be->box_full($t->translate("Error"), $t->translate("Access denied"));
    $auth->logout();
} else {
    $msg = $t->translate("You are logged in as") . " <b>" . $auth->auth["uname"] . "</b> " . $t->translate("with") . " " . "<b>" . $auth->auth["perm"] . "</b> " . $t->translate("permission") . "." . "<br>" . $t->translate("Your authentication is valid until") . " <b>" . timestr($auth->auth["exp"]) . "</b>";
    $bx->box_full($t->translate("Welcome to {$sys_name}"), $msg);
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();
示例#10
0
        $db->p("password");
        ?>
"></td>
  <td><input type="text" name="realname" size=12 maxlength=64 value="<?php 
        $db->p("realname");
        ?>
"></td>
  <td><input type="text" name="email_usr" size=12 maxlength=32 value="<?php 
        $db->p("email_usr");
        ?>
"></td>
<?php 
        $time = mktimestamp($db->f("modification_usr"));
        echo "  <td>" . timestr($time) . "</td>\n";
        $time = mktimestamp($db->f("creation_usr"));
        echo "  <td>" . timestr($time) . "</td>\n";
        ?>
  <td><?php 
        print $perm->perm_sel("perms", $db->f("perms"));
        ?>
</td>
  <td align=right>
   <input type="hidden" name="u_id" value="<?php 
        echo $db->p("user_id");
        ?>
">
<?php 
        echo "   <input type=\"submit\" name=\"u_kill\" value=\"" . $t->translate("Delete") . "\">\n";
        echo "   <input type=\"submit\" name=\"u_edit\" value=\"" . $t->translate("Change") . "\">\n";
        ?>
  </td>
 function testConfigure_preview()
 {
     global $t, $bx, $auth, $quorum, $other_tech_contents, $other_developing_proposals, $consultants;
     $args = $this->_generate_records(array('proid'), 32);
     $uname = 'this is the username';
     $auth->set_uname($uname);
     $quorum = 'this is the quro';
     $consultants = 'this is the consulatnts';
     $other_tech_contents = 'this is the other tech contents';
     $other_developing_proposals = 'this is the other tech proposals';
     $db_config = new mock_db_configure(144);
     $sinst = 0;
     $mask = array();
     $cf_mask = array();
     for ($idx = 0; $idx < 32; $idx++) {
         $cf_mask[0] = $mask[0] = ($idx & 0x1) > 0;
         $cf_mask[1] = $mask[1] = ($idx & 0x2) > 0;
         $cf_mask[2] = $mask[2] = ($idx & 0x4) > 0;
         $mask[3] = ($idx & 0x8) > 0;
         $mask[4] = ($idx & 0x10) > 0;
         $cf_mask[3] = $mask[3] && $mask[4];
         $this->set_msg('Test ' . $idx . " 0=>" . $mask[0] . " 1=>" . $mask[1] . " 2=>" . $mask[2] . " 3=>" . $mask[3] . " 4=>" . $mask[4]);
         $len = 948 + ($cf_mask[0] ? 38 : 0) + ($cf_mask[1] ? 64 : 0) + ($cf_mask[2] ? 72 : 0) + ($cf_mask[3] ? 48 : 0);
         $sinst = $this->_config__s_pi_d_s_pi__db($db_config, $sinst, $args[$idx]['proid'], $uname, $mask);
         $bx = $this->_create_default_box();
         $this->capture_call('configure_preview', $len + strlen(timestr(time())), $args[$idx]);
         $this->_checkFor_a_box('PREVIEW', '<center><b>%s</b></center>');
         $this->_checkFor_a_box('Project Configuration');
         $this->_configure_preview_checkfor_parts($cf_mask);
     }
     $this->_check_db($db_config);
 }
示例#12
0
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Password') . ':</b>');
$bx->box_column('left', '50%', '', html_input_password('password', 20, 32, $db->f('password')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Confirm Password') . ':</b>');
$bx->box_column('left', '50%', '', html_input_password('cpassword', 20, 32, $db->f('password')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Realname') . ':</b>');
$bx->box_column('left', '50%', '', html_input_text('realname', 20, 64, $db->f('realname')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('E-mail') . ':</b>');
$bx->box_column('left', '50%', '', html_input_text('email_usr', 20, 128, $db->f('email_usr')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Creation') . ':</b>');
$bx->box_column('left', '50%', '', timestr(mktimestamp($db->f('creation_usr'))));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Last Modification') . ':</b>');
$bx->box_column('left', '50%', '', timestr(mktimestamp($db->f('modification_usr'))));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Permission') . ':</b>');
$bx->box_column('left', '50%', '', $db->f('perms'));
$bx->box_next_row_of_columns();
$bx->box_colspan(2, 'center', '', html_form_submit($t->translate('Change'), 'u_edit'));
$bx->box_columns_end();
htmlp_form_hidden('u_id', $db->f('user_id'));
htmlp_form_end();
$bx->box_body_end();
$bx->box_end();
end_content();
require 'include/footer.inc';
@page_close();
 function testNews_preview()
 {
     global $subject, $text, $auth, $sess, $bx, $t;
     $text = "this is the text";
     $subject = "this is the subject";
     $auth->set_uname("username");
     $proid = 'fubar';
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     news_preview($proid);
     $this->set_text(capture_stop_and_get());
     $this->_checkFor_a_box('PREVIEW', '<center><b>%s</b></center>');
     $this->_checkFor_a_box('News', '%s: ' . $subject);
     $this->_testFor_lib_nick($auth->auth['uname']);
     $this->_testFor_string_length(947 + strlen(timestr(time())));
 }
                    }
                    echo "<br>{$fusrnam2} (<a href=\"" . $sys_url . "showprofile.php?devname={$fusrnam2}\">" . $sys_url . "showprofile.php?devname={$fusrnam2}</a>)\n";
                }
            }
        }
        if (isset($notify) && $msg != "") {
            $subj = "[" . $sys_name . "] Developers Watch for " . date("l dS of F Y") . "\n";
            $msg .= "\nYou get this DevCounter Developers Watch Notification,\n";
            $msg .= "because you have set a Developers Watch.\n";
            $msg .= "To suppress this Notification visit\n";
            $msg .= $sys_url . "watch.php\n";
            $msg .= "and delete your Developers Watch.\n\n";
            $msg .= " - The DevCounter crew\n";
            //			echo "<p>$msg";
            mail($email, $subj, $msg, "From: {$ml_newsfromaddr}\nReply-To: {$ml_newsreplyaddr}\nX-Mailer: PHP");
            $bx->box_full($t->translate("Developers Watch"), $t->translate("Developers Watch Notification was sent to") . " {$usrnam} &lt;{$email}&gt; " . timestr(time()));
        }
    }
    ?>
	<form method="get" action="<?php 
    $sess->pself_url();
    ?>
">
	<?php 
    echo "<input type=\"hidden\" name=\"notify\" value=\"send\">\n";
    echo "<center><p><input type=\"submit\" name=\"send\" value=\"" . $t->translate("Send Watch Notifications") . "\"></center>\n";
    echo "</form>\n";
}
?>
<!-- end content -->
 function testDeveloping_preview()
 {
     global $t, $bx, $auth;
     global $cost, $license, $cooperation, $valid_day, $valid_month, $valid_year, $start_day, $start_month, $start_year, $duration;
     $proid = 'this is the proid';
     $cost = 'ths is the cost';
     $license = 'thsi is the license';
     $cooperation = 'this is the coopeartion';
     $valid_day = 'this is the valid_day';
     $valid_month = 'thsi si the valid month';
     $valid_year = 'this is the valid year';
     $start_day = 'this is the start day';
     $start_month = 'this is the start month';
     $start_year = 'this is the start year';
     $duration = 'this is the duration';
     $slen = strlen(timestr(time())) + 1188;
     $bx = $this->_create_default_box();
     $this->capture_call('developing_preview', $slen, array($proid));
     $this->_checkFor_a_box('PREVIEW', '<center><b>%s</b></center>');
     $this->_checkFor_a_box('Developing Proposal');
     $v = array('Cost' => $cost . " euros", 'License' => $license, 'Cooperation' => $cooperation, 'Status' => 'Proposed', 'Validity' => timestr_middle(mktimestamp(date_to_timestamp($valid_day, $valid_month, $valid_year))), 'Start possible' => timestr_middle(mktimestamp(date_to_timestamp($start_day, $start_month, $start_year))), 'Duration' => $duration . " weeks");
     while (list($key, $val) = each($v)) {
         $str = sprintf('<b>%s:</b> %s\\n', $t->translate($key), $val);
         $this->_testFor_pattern('[<]..?[>]' . $this->_to_regexp($str));
     }
 }
# This is the text backend of the system
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session"));
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
}
header("Content-Type: text/plain");
// Disabling cache
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
require "./include/config.inc";
require "./include/lib.inc";
$db = new DB_SourceContact();
$db->query("SELECT * FROM contact WHERE contact.status='A' ORDER BY contact.modification DESC limit 10");
$i = 0;
while ($db->next_record()) {
    echo $db->f("name") . "\n";
    $timestamp = mktimestamp($db->f("modification"));
    echo timestr($timestamp) . "\n";
    echo $sys_url . "conbyconid.php?id=" . $db->f("conid") . "\n";
    $i++;
}
@page_close();
示例#17
0
######################################################################
# SourceAgency: Open Source Project Mediation & Management System
# ================================================
#
# Copyright (c) 2001-2003 by
#                Lutz Henckel (lutz.henckel@fokus.fraunhofer.de) and
#                Gregorio Robles (grex@scouts-es.org)
#
# BerliOS SourceAgency: http://sourcewell.berlios.de
# BerliOS - The OpenSource Mediator: http://www.berlios.de
#
# This file contains the logout: session and authentications finish
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "include/prepend.php3";
page_open(array("sess" => "SourceAgency_Session", "auth" => "SourceAgency_Auth", "perm" => "SourceAgency_Perm"));
$logout = 1;
// Special status for the logout page (menubar, etc.)
require "include/header.inc";
$bx = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
start_content();
$msg = $t->translate("You have been logged in as") . " <b>" . $auth->auth["uname"] . "</b> " . $t->translate("with") . " <b>" . $auth->auth["perm"] . "</b> " . $t->translate("permission") . ".<br>" . $t->translate("Your authentication was valid until") . " <b>" . timestr($auth->auth["exp"]) . "</b>.<p>" . $t->translate("This is all over now. You have been logged out") . ".";
$bx->box_full($t->translate("Logout"), $msg);
end_content();
require "include/footer.inc";
$auth->logout();
@page_close();
 function testshow_selected_content()
 {
     global $t, $bx, $db;
     $qs = array(0 => $this->queries['show_selected_content']);
     $db_config = new mock_db_configure(1);
     $args = $this->_generate_records(array('proid'), 1);
     $dat = $this->_generate_records(array('creation', 'username', 'skills', 'platform', 'architecture', 'docs', 'environment', 'specification'), 1);
     $db_config->add_query(sprintf($qs[0], $args[0]['proid']), 0);
     $db_config->add_record($dat[0], 0);
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('show_selected_content', 944, $args[0]);
     $str = '</a> - ' . timestr(mktimestamp($dat[0]['creation'])) . '</b>';
     $this->_testFor_pattern($this->_to_regexp($str));
     $this->_testFor_lib_nick($dat[0]['username']);
     $template = "<b>%s:</b> %s\n";
     $v = array('Skills' => $dat[0]['skills'], 'Plattform' => $dat[0]['platform'], 'Architecture' => $dat[0]['architecture'], 'Environment' => $dat[0]['environment'], 'Documentation' => $dat[0]['docs'], 'Technical Specification' => $dat[0]['specification']);
     while (list($key, $val) = each($v)) {
         $str = sprintf($template, $t->translate($key), $val);
         $this->_testFor_pattern('[<]..?[>]' . $this->_to_regexp($str));
     }
     $this->_check_db($db_config);
 }
 function testViews_show()
 {
     global $t, $bx, $db, $sess;
     $db_config = new mock_db_configure(3);
     $qs = array(0 => "SELECT * FROM views,description WHERE views.proid" . "=description.proid AND views.proid='%s'", 1 => "SELECT * FROM comments,auth_user WHERE proid='%s' AND " . "type='%s' AND number='%s' AND ref='%s' AND user_cmt" . "=username ORDER BY creation_cmt ASC");
     $args = $this->_generate_records(array('proid'), 2);
     $d = $this->_generate_records(array('creation', 'description_user', 'configure', 'news', 'comments', 'history', 'step3', 'step4', 'step5', 'cooperation', 'views'), 1);
     // test one: no records
     $db_config->add_query(sprintf($qs[0], $args[0]['proid']), 0);
     $db_config->add_num_row(0, 0);
     // test two: one record
     $db_config->add_query(sprintf($qs[0], $args[1]['proid']), 1);
     $db_config->add_num_row(1, 1);
     $db_config->add_record($d[0], 1);
     $db_config->add_record(false, 1);
     $db_config->add_query(sprintf($qs[1], $args[1]['proid'], 'Views', '0', '0'), 2);
     $db_config->add_num_row(0, 2);
     // test one
     $db = new DB_SourceAgency();
     $this->capture_call('views_show', 46, $args[0]);
     $this->assertEquals("<p>The views have not been configured yet.<p>\n", $this->get_text(), 'Line: ' . __LINE__);
     // test two
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('views_show', 4698 + strlen(timestr(mktimestamp($d[0]['creation']))), $args[1]);
     $this->_checkFor_a_box('Project Information Access');
     $this->_testFor_lib_nick($d[0]['description_user']);
     $str = " - " . timestr(mktimestamp($d[0]['creation'])) . "</b>";
     $this->_testFor_pattern($this->_to_regexp($str));
     $titles = array("View Project Configuration", "Write and Modify news", "Write comments", "See Project History", "See Step 3 (Milestones)", "See Step 4 (Referees)", "See Step 5 (Project Follow-up)", "See Developing Cooperation Proposals", "Project Permission Access");
     $this->_checkFor_column_titles($titles, 'right', '30%', '', '<b>%s</b>: ');
     $this->_testFor_lib_comment_it($args[1]['proid'], "Views", "", "0", "", "Comments on the views?");
     $values = array($d[0]["views"], $d[0]["cooperation"], $d[0]["step5"], $d[0]["step4"], $d[0]["step3"], $d[0]["history"], $d[0]["comments"], $d[0]["news"], $d[0]["configure"]);
     $this->_checkFor_column_values($values);
     $this->_check_db($db_config);
 }
示例#20
0
">
				<input type="hidden" name="erstellungszeit" value="<?php 
        echo $erstellungszeit;
        ?>
">
                        </TD>
                   </TR>
                   <TR>
                        <TD align="right" valign="top"><B><?php 
        echo $t->translate("Last updated");
        ?>
:</B></TD>
                        <TD colspan="2">
                                <?php 
        $timestamp = mktime(substr($aenderungszeit, 0, 2), substr($aenderungszeit, 3, 2), substr($aenderungszeit, 6, 2), substr($aenderungsdatum, 3, 2), substr($aenderungsdatum, 0, 2), substr($aenderungsdatum, 6, 4));
        echo timestr($timestamp);
        ?>
                                <input type="hidden" name="aenderungsdatum" value="<?php 
        echo $aenderungsdatum;
        ?>
">
				<input type="hidden" name="aenderungszeit" value="<?php 
        echo $aenderungszeit;
        ?>
">
                        </TD>
                   </TR>
                   <TR>
                        <TD align="right" valign="top"><B><?php 
        echo $t->translate("Language");
        ?>
 function testMonitor_preview()
 {
     global $importance, $auth, $bx;
     $row = array(0 => $this->_generate_array(array("proid", "uname"), 0));
     //
     // first call
     //
     $importance = "middle";
     $auth->set_uname($row[0]["uname"]);
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     monitor_preview($row[0]["proid"]);
     $this->set_text(capture_stop_and_get());
     $this->_testFor_string_length(1021 + strlen(timestr(time())));
     $this->_testFor_pattern("<b>by uname_0<\\/b>");
 }
示例#22
0
<td align=right><?php 
    echo $t->translate("Last modified");
    ?>
:</td><td><?php 
    echo timestr($time);
    ?>
</td></tr>
<tr>
<?php 
    $time = mktimestamp($db->f("creation_usr"));
    ?>
<td align=right><?php 
    echo $t->translate("Created");
    ?>
:</td><td><?php 
    echo timestr($time);
    ?>
</td></tr>
<tr>
<td align=right><?php 
    echo $t->translate("Permission");
    ?>
:</td><td><?php 
    $db->p("perms");
    ?>
</td></tr>
<tr>
<td></td>
<td><input type="hidden" name="u_id"   value="<?php 
    $db->p("user_id");
    ?>
示例#23
0
# ===============================================================
#
# Copyright (c) 2001-2003 by
#                Gregorio Robles (grex@scouts-es.org) and
#                Lutz Henckel (lutz.henckel@fokus.fraunhofer.de)
#
# BerliOS SourceAgency: http://sourceagency.berlios.de
# BerliOS - The OpenSource Mediator: http://www.berlios.de
#
# This is the login page: here authenticated sessions start
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require 'include/prepend.php3';
page_open(array('sess' => 'SourceAgency_Session', 'auth' => 'SourceAgency_Auth', 'perm' => 'SourceAgency_Perm'));
require 'include/header.inc';
$bx = new box('80%', $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
$be = new box('80%', $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_error_font_color, $th_box_body_align);
start_content();
if ($perm->have_perm('devel_pending') || $perm->have_perm('sponsor_pending')) {
    $be->box_full($t->translate('Error'), $t->translate('You have not yet confirmed your account. Please check your e-mail, there should be a message that contains a confirmation link. Only after you have clicked this link you can start using SourceAgency.'));
    $auth->logout();
} else {
    $msg = $t->translate('You are logged in as') . ' <b>' . $auth->auth['uname'] . '</b> ' . $t->translate('with') . ' ' . '<b>' . $t->translate($auth->auth['perm']) . '</b> ' . $t->translate('permission') . '.' . '<br>' . $t->translate('Your authentication is valid until') . ' <b>' . timestr($auth->auth['exp']) . '</b>';
    $bx->box_full($t->translate('Welcome to ') . $sys_name, $msg);
}
end_content();
require 'include/footer.inc';
@page_close();
示例#24
0
                    break;
                case "update":
                    $db3 = new DB_SourceWell();
                    $db3->query("UPDATE software SET modification='{$db2_creation_his}' WHERE appid='{$db_appid}'");
                    $timestamp = mktimestamp($db2_creation_his);
                    $title = "Modification date is updated to " . timestr($timestamp) . "\n";
                    $bx->box_title($title);
                    break;
                case "insert":
                    $db3 = new DB_SourceWell();
                    $db_user = $db->f("user");
                    $db_version = $db->f("version");
                    $db3->query("INSERT history SET appid='{$db_appid}', user_his='{$db_user}', creation_his='{$db_modification}', version_his='{$db_version}'");
                    // echo "<p>INSERT history SET appid='$db_appid', user_his='$db_user', creation_his='$db_modification', version_his='$db_version'\n";
                    $timestamp = mktimestamp($db_modification);
                    $title = "History date is updated to " . timestr($timestamp) . "\n";
                    $bx->box_title($title);
                    break;
                default:
                    $be->box_full($t->translate("Error"), $t->translate("Invalid action"));
                    break;
            }
            $bx->box_end();
            $i++;
        }
    }
    if ($i < 1) {
        $msg = $t->translate("All dates are consistent");
        $bi->box_full($t->translate("Check Date"), $msg);
    }
}
示例#25
0
$db_summary->query("SELECT * FROM auth_user WHERE perms='devel' " . "ORDER BY creation_usr DESC LIMIT 5");
if ($db_summary->num_rows() > 0) {
    while ($db_summary->next_record()) {
        echo '<div class=newsind>&#149;&nbsp;' . html_link('http://devcounter.berlios.de/showprofile.php', array('devname' => $db_summary->f('username')), $db_summary->f('username')) . '<br>[' . timestr(mktimestamp($db_summary->f('creation_usr'))) . ']</div>';
    }
}
$bx->box_body_end();
$bx->box_end();
print "<br>\n";
$bx->box_begin();
$bx->box_title($t->translate('Recent Sponsors'));
$bx->box_body_begin();
$db_summary->query("SELECT * FROM auth_user WHERE perms='sponsor' " . "ORDER BY creation_usr DESC LIMIT 5");
if ($db_summary->num_rows() > 0) {
    while ($db_summary->next_record()) {
        echo '<div class=newsind>&#149;&nbsp;' . html_link('http://devcounter.berlios.de/showprofile.php', array('devname' => $db_summary->f('username')), $db_summary->f('username')) . '<br>[' . timestr(mktimestamp($db_summary->f('creation_usr'))) . ']</div>';
    }
}
$bx->box_body_end();
$bx->box_end();
$bx->box_column_finish();
$bx->box_columns_end();
$bx->box_body_end();
$bx->box_end();
//  $db->query("SELECT * FROM description");
//  while ($db->next_record()) {
//    htmlp_link('summary.php',array('proid' => $db->f('proid')),
//               'Project '.$db->f('proid'));
//    echo ' ('.$db->f('project_title').")<br>\n";
//  }
end_content();