//
and comment text 87 return nil
88}
89
90func getCurrentStaff(request *http.Request) (string, error) { //TODO after refactor, check if still used 91 staff, err := GetStaffFromRequest(request)
92 if err != nil {
93 return "", err
//
and comment text250 // isSticky := request.FormValue("modstickied") == "on"
251 // isLocked := request.FormValue("modlocked") == "on"
252
253 //post has no referrer, or has a referrer from a different domain, probably a spambot254 if !serverutil.ValidReferer(request) {
255 gcutil.LogWarning().
256 Str("spam", "badReferer").
//
and comment text 52 return section.ID, err
53 }
54 if err != nil {
55 return 0, err //other error 56 }
57 return id, nil
58}
//
and comment text180func (staff *Staff) CreateLoginSession(key string) error {
181 const insertSQL = `INSERT INTO DBPREFIXsessions (staff_id,data,expires) VALUES(?,?,?)`
182 const updateSQL = `UPDATE DBPREFIXstaff SET last_login = CURRENT_TIMESTAMP WHERE id = ?`
183 _, err := ExecSQL(insertSQL, staff.ID, key, time.Now().Add(time.Duration(time.Hour*730))) //TODO move amount of time to config file184 if err != nil {
185 return err
186 }
//
and comment text70 //None of the nodes directly contain text
71 //truncate children first
72 charactersLeft, linesLeft = truncateHTMLNodes(node.FirstChild, charactersLeft, linesLeft)
73 //Pass values to siblings (sibling code will immediately exit if no more chars allowed, and remove self)74 return truncateHTMLNodes(node.NextSibling, charactersLeft, linesLeft)
75 case x_html.TextNode:
76 if len(node.Data) > charactersLeft {
Comments should have a space between the //
and the comment text
//This is a comment
// This is a comment