mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-03 07:36:23 -07:00
fixing merge (push)
This commit is contained in:
parent
2d7bf4a826
commit
ebf891e785
4 changed files with 2 additions and 54 deletions
3
src/TODO
3
src/TODO
|
@ -3,11 +3,8 @@
|
|||
- Set up load balancing
|
||||
- Clean up config file template
|
||||
- Set up HTTPS for management
|
||||
- gzip-encoding for html, css, and javascript
|
||||
- Set up backend mode, compatibility with nginx and Apache
|
||||
- Set up templating
|
||||
- Set up timezone adjusting
|
||||
- Set up new mod menu style, integrated with board pages
|
||||
- Give administrator server control options (restart/shutdown daemon, etc)
|
||||
- Set up basic posting/board interaction
|
||||
- find out what changes were made in Kusaba 0.9.3 to fix XSS vulnerability
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
version float32 = 0.2
|
||||
version float32 = 0.3
|
||||
)
|
||||
|
||||
|
||||
|
@ -25,7 +25,6 @@ func main() {
|
|||
needs_initial_setup = true
|
||||
runInitialSetup()
|
||||
}
|
||||
|
||||
fmt.Println("Loading and parsing templates...")
|
||||
initTemplates()
|
||||
fmt.Println("Initializing server...")
|
||||
|
|
|
@ -92,11 +92,7 @@ func makeHandler(fn func(http.ResponseWriter, *http.Request)) http.HandlerFunc {
|
|||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
func exitWithErrorPage(w http.ResponseWriter, err string) {
|
||||
=======
|
||||
func exitWithErrorPage(writer http.ResponseWriter, err string) {
|
||||
>>>>>>> 0b6e2bc132fad7f323348b27857431ea8674c382
|
||||
error_page_bytes,_ := ioutil.ReadFile("templates/error.html")
|
||||
error_page := string(error_page_bytes)
|
||||
error_page = strings.Replace(error_page,"{ERRORTEXT}", err,-1)
|
||||
|
|
44
src/sql.go
44
src/sql.go
|
@ -3,16 +3,12 @@ package main
|
|||
import (
|
||||
"os"
|
||||
"fmt"
|
||||
//"database/sql"
|
||||
//_ "github.com/go-sql-driver/mysql"
|
||||
|
||||
"github.com/ziutek/mymysql/mysql"
|
||||
_ "github.com/ziutek/mymysql/native" // Native engine
|
||||
//_ "github.com/ziutek/mymysql/thrsafe" // Thread safe engine
|
||||
)
|
||||
|
||||
var (
|
||||
//db *sql.DB
|
||||
db mysql.Conn
|
||||
db_connected = false
|
||||
)
|
||||
|
@ -35,43 +31,3 @@ func connectToSQLServer(usedb bool) {
|
|||
}
|
||||
db_connected = true
|
||||
}
|
||||
|
||||
|
||||
func dbTests() {
|
||||
results,err := db.Start("SELECT * FROM `"+config.DBprefix+"staff")
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
os.Exit(2)
|
||||
}
|
||||
/*var entry StaffTable
|
||||
if err != nil {
|
||||
error_log.Write(err.Error())
|
||||
}
|
||||
for results.Next() {
|
||||
err = results.Scan(&entry.username,&entry.password_checksum,&entry.rank)
|
||||
//if err != nil { panic(err) }
|
||||
}*/
|
||||
|
||||
for {
|
||||
row, err := results.GetRow()
|
||||
if err != nil {
|
||||
error_log.Write(err.Error())
|
||||
}
|
||||
|
||||
if row == nil {
|
||||
// No more rows
|
||||
break
|
||||
}
|
||||
|
||||
// Print all cols
|
||||
for _, col := range row {
|
||||
if col == nil {
|
||||
fmt.Print("<NULL>")
|
||||
} else {
|
||||
os.Stdout.Write(col.([]byte))
|
||||
}
|
||||
fmt.Print(" ")
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue