Commit 0bd61292 authored by Richard Mansfield's avatar Richard Mansfield
Browse files
parents fa35edc0 9ad0fdcc
mahara (0.3.1-1) unstable; urgency=low
* Bugfix release
* Add question about SMTP hosts to config
* Fixed Martyn's e-mail address
-- Nigel McNie <nigel@catalyst.net.nz> Mon, 15 Jan 2007 13:14:50 +1300
mahara (0.3-1) unstable; urgency=low
* New release
-- Martyn Smith <martyn@flange.wgtn.cat-it.co.nz> Fri, 12 Jan 2007 21:52:46 +1300
-- Martyn Smith <martyn@catalyst.net.nz> Fri, 12 Jan 2007 21:52:46 +1300
mahara (0.2-2) unstable; urgency=low
* Added servername to the config file
* Added simple mod_expires directives for the default theme and js
-- Martyn Smith <martyn@flange.wgtn.cat-it.co.nz> Fri, 12 Jan 2007 09:22:16 +1300
-- Martyn Smith <martyn@catalyst.net.nz> Fri, 12 Jan 2007 09:22:16 +1300
mahara (0.2-1) unstable; urgency=low
......
......@@ -16,3 +16,5 @@ db_input $PRIORITY mahara/db_user || true
db_go
db_input $PRIORITY mahara/servername || true
db_go
db_input $PRIORITY mahara/smtphosts || true
db_go
......@@ -38,6 +38,10 @@ case "$1" in
set_config dbuser "${RET}"
db_get mahara/servername
set_config wwwroot "http://${RET}/"
db_get mahara/smtphosts
if [ -n "${RET}" ]; then
set_config smtphosts "${RET}"
fi
# Set Dataroot
chown -R www-data:www-data /var/lib/mahara
......
......@@ -38,6 +38,10 @@ case "$1" in
set_config dbuser "${RET}"
db_get mahara/servername
set_config wwwroot "http://${RET}/"
db_get mahara/smtphosts
if [ -n "${RET}" ]; then
set_config smtphosts "${RET}"
fi
# Set Dataroot
chown -R www-data:www-data /var/lib/mahara
......
......@@ -32,3 +32,12 @@ Description: Server name:
.
Note that this is just the domain name, so for "http://my.site.com" you only
need to enter "my.site.com"
Template: mahara/smtphosts
Type: string
Default:
Description: SMTP Hosts:
Comma separated list of SMTP servers to use to send mail
.
If you leave this blank, the system mailer will be used. Generally, this will
work fine
......@@ -31,7 +31,6 @@ require('init.php');
$smarty = smarty();
$smarty->assign('page_content', get_site_page_content('about'));
$smarty->assign('site_menu', site_menu());
$smarty->assign('searchform', searchform());
$smarty->display('sitepage.tpl');
......
......@@ -137,7 +137,6 @@ function showHideMessage(id) {
JAVASCRIPT;
$smarty = smarty(array('tablerenderer'));
$smarty->assign('site_menu', site_menu());
$smarty->assign('selectall', 'toggleChecked(\'tocheck\'); return false;');
$smarty->assign('markread', 'markread(this); return false;');
$smarty->assign('typechange', 'activitylist.doupdate({\'type\':this.options[this.selectedIndex].value});');
......
......@@ -177,7 +177,6 @@ if (!$viewusers = get_records_sql_array($sql, array($USER->get('id')))) {
}
$smarty = smarty(array('tablerenderer'));
$smarty->assign('site_menu', site_menu());
$smarty->assign('viewusers', $viewusers);
$smarty->assign('typestr', get_string('views', 'activity'));
$smarty->assign('selectall', 'toggleChecked(\'tocheck\'); return false;');
......
......@@ -50,13 +50,10 @@ if (!call_static_method($classname, 'has_config')) {
$form = call_static_method($classname, 'get_config_options');
if (isset($form['submitfunction'])) {
$submitfunction = $form['submitfunction'];
}
if (isset($form['validatefunction'])) {
$validatefunction = $form['validatefunction'];
}
$form['plugintype'] = $plugintype;
$form['pluginname'] = $pluginname;
$form['name'] = 'pluginconfig';
$form['pluginconfigform'] = true;
$form['jsform'] = true;
$form['successcallback'] = 'pluginconfig_submit';
$form['validatecallback'] = 'pluginconfig_validate';
......@@ -72,6 +69,10 @@ $form['elements']['type'] = array(
'type' => 'hidden',
'value' => $type
);
$form['elements']['save'] = array(
'type' => 'submit',
'value' => get_string('save'),
);
$smarty = smarty();
$smarty->assign('form', pieform($form));
......@@ -83,18 +84,14 @@ $smarty->display('admin/extensions/pluginconfig.tpl');
function pluginconfig_submit(Pieform $form, $values) {
$success = false;
global $submitfunction, $plugintype, $pluginname, $classname;
if (!empty($submitfunction)) {
try {
call_static_method($classname, $submitfunction, $values);
$success = true;
}
catch (Exception $e) {
$success = false;
}
global $plugintype, $pluginname, $classname;
try {
call_static_method($classname, 'save_config_options', $values);
$success = true;
}
else {
// call set_plugin_config and stuffs
catch (Exception $e) {
$success = false;
}
if ($success) {
......@@ -106,9 +103,10 @@ function pluginconfig_submit(Pieform $form, $values) {
}
function pluginconfig_validate(PieForm $form, $values) {
global $validatefunction, $plugintype, $pluginname, $classname;
if (!empty($validatefunction)) {
call_static_method($classname, $validatefunction, $form, $values);
global $plugintype, $pluginname, $classname;
if (method_exists($classname, 'validate_config_options')) {
call_static_method($classname, 'validate_config_options', $form, $values);
}
}
?>
......@@ -26,6 +26,7 @@
defined('INTERNAL') || die();
$string['blog'] = 'Blog';
$string['addblog'] = 'Add Blog';
$string['addpost'] = 'Add Post';
$string['alignment'] = 'Alignment';
......@@ -95,6 +96,7 @@ $string['title'] = 'Title';
$string['verticalspace'] = 'Vertical space';
$string['viewblog'] = 'View Blog';
$string['youarenottheownerofthisblogpost'] = 'You are not the owner of this blog post';
$string['cannotdeleteblogpost'] = 'An error occured removing this blog post.';
$string['baseline'] = 'Baseline';
$string['top'] = 'Top';
......
......@@ -407,6 +407,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
return;
}
delete_records('artefact_blog_blogpost_file', 'blogpost', $this->id);
delete_records('artefact_blog_blogpost', 'blogpost', $this->id);
parent::delete();
......
......@@ -4,14 +4,12 @@
</div>
{include file="columnleftstart.tpl"}
<div class="maincontent">
<h2>{str section="artefact.blog" tag="blogsettings"}</h2>
<div class="viewblogbtn">
<a href="{$WWWROOT}artefact/blog/view/?id={$blog->get('id')}">{str section="artefact.blog" tag="viewblog"}</a>
</div>
{$editform}
</div>
{include file="columnleftend.tpl"}
{include file="footer.tpl"}
......@@ -41,6 +41,7 @@ $enc_files = json_encode(get_string('attachedfiles', 'artefact.blog'));
$enc_delete = json_encode(get_string('delete', 'artefact.blog'));
$enc_delete_confirm = json_encode(get_string('deleteblogpost?', 'artefact.blog'));
$enc_postedon = json_encode(get_string('postedon', 'artefact.blog'));
$enc_cannotdeleteblogpost = json_encode(get_string('cannotdeleteblogpost', 'artefact.blog'));
return <<<EOJAVASCRIPT
......@@ -156,7 +157,7 @@ postlist.rowfunction = function(d, n, gd) {
}
}
else {
alert('yay');
displayMessage({$enc_cannotdeleteblogpost}, 'error');
}
},
function (error) {
......
......@@ -388,7 +388,23 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
}
public static function get_config_options() {
return array(); // @todo
$defaultquota = get_config_plugin('artefact', 'file', 'defaultquota');
if (empty($defaultquota)) {
$defaultquota = 1024 * 1024 * 10;
}
return array(
'elements' => array(
'defaultquota' => array(
'title' => get_string('defaultquota', 'artefact.file'),
'type' => 'bytes',
'defaultvalue' => $defaultquota,
),
),
);
}
public static function save_config_options($values) {
set_config_plugin('artefact', 'file', 'defaultquota', $values['defaultquota']);
}
}
......
......@@ -129,6 +129,7 @@ function profileform_submit(Pieform $form, $values) {
db_begin();
$now = db_format_timestamp(time());
$email_errors = array();
foreach ($element_list as $element => $type) {
......@@ -148,17 +149,22 @@ function profileform_submit(Pieform $form, $values) {
$key = get_random_key();
$key_url = get_config('wwwroot') . 'artefact/internal/validate.php?email=' . rawurlencode($email) . '&key=' . $key;
email_user(
(object)array(
'firstname' => $USER->get('firstname'),
'lastname' => $USER->get('lastname'),
'preferredname' => $USER->get('preferredname'),
'email' => $email,
),
null,
get_string('emailvalidation_subject', 'artefact.internal'),
get_string('emailvalidation_body', 'artefact.internal', $USER->get('firstname'), $email, $key_url)
);
try {
email_user(
(object)array(
'firstname' => $USER->get('firstname'),
'lastname' => $USER->get('lastname'),
'preferredname' => $USER->get('preferredname'),
'email' => $email,
),
null,
get_string('emailvalidation_subject', 'artefact.internal'),
get_string('emailvalidation_body', 'artefact.internal', $USER->get('firstname'), $email, $key_url)
);
}
catch (EmailException $e) {
$email_errors[] = $email;
}
insert_record(
'artefact_internal_profile_email',
......@@ -253,6 +259,10 @@ function profileform_submit(Pieform $form, $values) {
$form->json_reply(PIEFORM_ERR, get_string('profilefailedsaved','artefact.internal'));
}
if (count($email_errors)) {
$form->json_reply(PIEFORM_ERR, array('message' => get_string('emailingfailed', 'artefact.internal', join(', ', $email_errors))));
}
$form->json_reply(PIEFORM_OK, get_string('profilesaved','artefact.internal'));
}
......
......@@ -86,4 +86,6 @@ $string['emailactivation'] = 'Email Activation';
$string['emailactivationsucceeded'] = 'Email Activation Successful';
$string['emailactivationfailed'] = 'Email Activation Failed';
$string['emailingfailed'] = 'Profile saved, but emails were not sent to: %s';
?>
......@@ -229,13 +229,7 @@ class ArtefactTypeProfile extends ArtefactType {
$public = self::get_public_fields();
$alwaysmandatory = self::get_always_mandatory_fields();
$form = array(
'name' => 'profileprefs',
'method' => 'post',
'ajaxpost' => true,
'plugintype' => 'artefact',
'pluginname' => 'internal',
'renderer' => 'multicolumntable',
'submitfunction' => 'save_config_options',
'elements' => array(
'mandatory' => array(
'title' => ' ',
......@@ -300,10 +294,6 @@ class ArtefactTypeProfile extends ArtefactType {
)
);
$form['elements']['submit'] = array(
'type' => 'submit',
'value' =>get_string('save')
);
return $form;
}
......
......@@ -68,6 +68,7 @@ class User {
'lastname' => '',
'preferredname' => '',
'email' => '',
'profileicon' => '',
'accountprefs' => array(),
'activityprefs' => array(),
'sesskey' => ''
......
......@@ -106,7 +106,6 @@ function contactus_submit(Pieform $form, $values) {
$smarty = smarty();
$smarty->assign('page_content', $contactform);
$smarty->assign('site_menu', site_menu());
$smarty->assign('searchform', searchform());
$smarty->display('sitepage.tpl');
......
......@@ -121,7 +121,7 @@ function forgotpass_validate(Pieform $form, $values) {
}
}
function forgotpass_submit($values) {
function forgotpass_submit(Pieform $form, $values) {
global $SESSION;
try {
......@@ -167,7 +167,7 @@ function forgotpasschange_validate(Pieform $form, $values) {
// password_validate to maharalib, use it in places specified, test with a drop/create run
// support autofocus => (true|'id'), remove stuff doing autofocus from where it is, focus error fields
// commit stuff
function forgotpasschange_submit($values) {
function forgotpasschange_submit(Pieform $form, $values) {
global $SESSION, $USER;
if (!$user = get_record('usr', 'id', $values['user'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment