2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
|
int iJulianDay;
if( g.db==0 ) return;
if( db_transaction_nesting_depth()!=0 ){
fossil_warning("Called email_auto_exec() from within transaction "
"started at %z", db_transaction_start_point());
return;
}
db_begin_transaction();
if( !email_tables_exist() ) goto autoexec_done;
if( !db_get_boolean("email-autoexec",0) ) goto autoexec_done;
email_send_alerts(0);
iJulianDay = db_int(0, "SELECT julianday('now')");
if( iJulianDay>db_get_int("email-last-digest",0) ){
if( db_transaction_nesting_depth()!=1 ){
fossil_warning("Transaction nesting error prior to digest processing");
}else{
db_set_int("email-last-digest",iJulianDay,0);
email_send_alerts(SENDALERT_DIGEST);
}
}
autoexec_done:
db_end_transaction(0);
}
/*
** WEBPAGE: contact_admin
**
** A web-form to send an email message to the repository administrator,
** or (with appropriate permissions) to anybody.
|
<
|
|
>
<
<
|
|
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
|
int iJulianDay;
if( g.db==0 ) return;
if( db_transaction_nesting_depth()!=0 ){
fossil_warning("Called email_auto_exec() from within transaction "
"started at %z", db_transaction_start_point());
return;
}
if( !email_tables_exist() ) return;
if( !db_get_boolean("email-autoexec",0) ) return;
db_begin_write();
email_send_alerts(0);
iJulianDay = db_int(0, "SELECT julianday('now')");
if( iJulianDay>db_get_int("email-last-digest",0) ){
if( db_transaction_nesting_depth()!=1 ){
fossil_warning("Transaction nesting error prior to digest processing");
}else{
db_set_int("email-last-digest",iJulianDay,0);
email_send_alerts(SENDALERT_DIGEST);
}
}
db_commit_transaction();
}
/*
** WEBPAGE: contact_admin
**
** A web-form to send an email message to the repository administrator,
** or (with appropriate permissions) to anybody.
|