backup/restore); Tidied Postgres table.
fwrite ($bf,full_tag("CTYPE",6,false,$conversation->ctype));
fwrite ($bf,full_tag("FORMAT",6,false,$conversation->format));
fwrite ($bf,full_tag("SUBJECT",6,false,$conversation->subject));
+
+ //if we've selected to backup users info, then execute backup_dialogue_entries
+ if ($preferences->mods["dialogue"]->userinfo) {
+ $status = backup_dialogue_entries($bf,$preferences,$conversation->id);
+ }
//End entry
$status =fwrite ($bf,end_tag("CONVERSATION",5,true));
- }
- //if we've selected to backup users info, then execute backup_dialogue_entries
- if ($preferences->mods["dialogue"]->userinfo) {
- $status = backup_dialogue_entries($bf,$preferences,$conversation->id);
}
//Write end tag
multipleconversations INT NOT NULL default '0',
maildefault INT NOT NULL default '0',
timemodified INT8 NOT NULL default '0',
- name varchar(255) default NULL,
+ name varchar(255) NOT NULL default '',
intro text
) ;
#
INSERT INTO prefix_log_display VALUES ('dialogue', 'view', 'dialogue', 'name');
+
require_variable($action); // need something to do!
-
+
+ // vet conversation id, if present
+ if (!empty($_REQUEST['cid'])) {
+ if ($conversation = get_record("dialogue_conversations", "id", $_REQUEST['cid'])) {
+ if (($conversation->userid <> $USER->id) and ($conversation->recipientid <> $USER->id)) {
+ error("Dialogue id incorrect");
+ }
+ } else {
+ error("Dialogue: Conversation record not found");
+ }
+ }
+
/************** close conversation ************************************/
if ($action == 'closeconversation') {
if (empty($_GET['cid'])) {
$olduserid = backup_todb($entry_info['#']['USERID']['0']['#']);
//Now, build the dialogue_ENTRIES record structure
- $entry->dialogue = $new_dialogue_id;
+ $entry->dialogueid = $new_dialogue_id;
$entry->conversationid = $new_conversation_id;
$entry->userid = backup_todb($entry_info['#']['USERID']['0']['#']);
$entry->timecreated = backup_todb($entry_info['#']['TIMECREATED']['0']['#']);